home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: Mailbox/MIME Entity
(archive/mbox).
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| Mailbox/MIME Entity (archive/mbox)
| magic
| Supported |
100%
| dexvert
| Internet Message Format (text/imf)
| magic
| Supported |
1%
| dexvert
| PageFocus Data (other/pageFocusData)
| ext
| Unsupported |
1%
| dexvert
| Banyans VINES patch data (other/banyansVINESPatchData)
| ext
| Unsupported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| Mailbox text, 1st line "From prove@batcomputer.tn.cornell.edu Tue Dec 16 13:56:15 1986", ASCII text
| default
| |
100%
| TrID
| E-Mail message (Var. 2)
| default
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| detectItEasy
| Format: Plain text[LF]
| default
| |
100%
| xdgMime
| application/mbox
| default (weak)
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 46 72 6f 6d 20 70 72 6f | 76 65 40 62 61 74 63 6f |From pro|ve@batco|
|00000010| 6d 70 75 74 65 72 2e 74 | 6e 2e 63 6f 72 6e 65 6c |mputer.t|n.cornel|
|00000020| 6c 2e 65 64 75 20 54 75 | 65 20 44 65 63 20 31 36 |l.edu Tu|e Dec 16|
|00000030| 20 31 33 3a 35 36 3a 31 | 35 20 31 39 38 36 0a 50 | 13:56:1|5 1986.P|
|00000040| 61 74 68 3a 20 62 65 6e | 6f 21 73 65 69 73 6d 6f |ath: ben|o!seismo|
|00000050| 21 72 6f 63 68 65 73 74 | 65 72 21 63 6f 72 6e 65 |!rochest|er!corne|
|00000060| 6c 6c 21 62 61 74 63 6f | 6d 70 75 74 65 72 21 70 |ll!batco|mputer!p|
|00000070| 72 6f 76 65 0a 46 72 6f | 6d 3a 20 70 72 6f 76 65 |rove.Fro|m: prove|
|00000080| 40 62 61 74 63 6f 6d 70 | 75 74 65 72 2e 74 6e 2e |@batcomp|uter.tn.|
|00000090| 63 6f 72 6e 65 6c 6c 2e | 65 64 75 20 28 52 6f 67 |cornell.|edu (Rog|
|000000a0| 65 72 20 4f 76 65 29 0a | 4e 65 77 73 67 72 6f 75 |er Ove).|Newsgrou|
|000000b0| 70 73 3a 20 6e 65 74 2e | 73 6f 75 72 63 65 73 0a |ps: net.|sources.|
|000000c0| 53 75 62 6a 65 63 74 3a | 20 50 52 45 50 3a 20 66 |Subject:| PREP: f|
|000000d0| 6f 72 74 72 61 6e 20 70 | 72 65 70 72 6f 63 65 73 |ortran p|reproces|
|000000e0| 73 6f 72 2c 20 70 61 72 | 74 20 31 2f 32 0a 4b 65 |sor, par|t 1/2.Ke|
|000000f0| 79 77 6f 72 64 73 3a 20 | 66 6f 72 74 72 61 6e 20 |ywords: |fortran |
|00000100| 2c 20 70 72 65 70 72 6f | 63 65 73 73 6f 72 2c 20 |, prepro|cessor, |
|00000110| 63 72 61 79 0a 4d 65 73 | 73 61 67 65 2d 49 44 3a |cray.Mes|sage-ID:|
|00000120| 20 3c 31 38 34 30 40 62 | 61 74 63 6f 6d 70 75 74 | <1840@b|atcomput|
|00000130| 65 72 2e 74 6e 2e 63 6f | 72 6e 65 6c 6c 2e 65 64 |er.tn.co|rnell.ed|
|00000140| 75 3e 0a 44 61 74 65 3a | 20 31 36 20 44 65 63 20 |u>.Date:| 16 Dec |
|00000150| 38 36 20 31 38 3a 35 36 | 3a 31 35 20 47 4d 54 0a |86 18:56|:15 GMT.|
|00000160| 4f 72 67 61 6e 69 7a 61 | 74 69 6f 6e 3a 20 54 68 |Organiza|tion: Th|
|00000170| 65 6f 72 79 20 43 65 6e | 74 65 72 2c 20 43 6f 72 |eory Cen|ter, Cor|
|00000180| 6e 65 6c 6c 20 55 2e 2c | 20 49 74 68 61 63 61 20 |nell U.,| Ithaca |
|00000190| 4e 59 0a 4c 69 6e 65 73 | 3a 20 31 39 35 34 0a 0a |NY.Lines|: 1954..|
|000001a0| 0a 20 20 20 20 20 54 68 | 69 73 20 69 73 20 70 61 |. Th|is is pa|
|000001b0| 72 74 20 31 20 6f 66 20 | 32 20 20 6f 66 20 61 20 |rt 1 of |2 of a |
|000001c0| 70 72 65 70 72 6f 63 65 | 73 73 6f 72 20 66 6f 72 |preproce|ssor for|
|000001d0| 20 66 6f 72 74 72 61 6e | 2c 20 77 68 69 63 68 20 | fortran|, which |
|000001e0| 0a 73 75 70 70 6f 72 74 | 73 20 6d 61 63 72 6f 73 |.support|s macros|
|000001f0| 2c 20 66 6c 6f 77 20 63 | 6f 6e 74 72 6f 6c 20 65 |, flow c|ontrol e|
|00000200| 78 74 65 6e 73 69 6f 6e | 73 2c 20 76 65 63 74 6f |xtension|s, vecto|
|00000210| 72 20 73 74 61 74 65 6d | 65 6e 74 0a 73 68 6f 72 |r statem|ent.shor|
|00000220| 74 68 61 6e 64 2c 20 61 | 6e 64 20 61 75 74 6f 6d |thand, a|nd autom|
|00000230| 61 74 69 63 20 6c 6f 6f | 70 20 75 6e 72 6f 6c 6c |atic loo|p unroll|
|00000240| 69 6e 67 20 66 6f 72 20 | 63 65 72 74 61 69 6e 20 |ing for |certain |
|00000250| 63 6c 61 73 73 65 73 20 | 6f 66 0a 6c 6f 6f 70 73 |classes |of.loops|
|00000260| 2e 20 20 49 74 20 69 73 | 20 77 72 69 74 74 65 6e |. It is| written|
|00000270| 20 69 6e 20 67 65 6e 65 | 72 69 63 20 63 20 61 6e | in gene|ric c an|
|00000280| 64 20 77 69 6c 6c 20 72 | 75 6e 20 6f 6e 20 6e 65 |d will r|un on ne|
|00000290| 61 72 6c 79 20 61 6e 79 | 0a 6d 61 63 68 69 6e 65 |arly any|.machine|
|000002a0| 3a 20 69 62 6d 70 63 2c | 20 53 75 6e 2c 20 43 72 |: ibmpc,| Sun, Cr|
|000002b0| 61 79 58 4d 50 2c 20 44 | 65 66 69 6e 69 63 6f 6e |ayXMP, D|efinicon|
|000002c0| 20 64 73 69 32 30 2e 0a | 0a 23 20 54 68 69 73 20 | dsi20..|.# This |
|000002d0| 69 73 20 61 20 73 68 65 | 6c 6c 20 61 72 63 68 69 |is a she|ll archi|
|000002e0| 76 65 2e 20 20 52 65 6d | 6f 76 65 20 61 6e 79 74 |ve. Rem|ove anyt|
|000002f0| 68 69 6e 67 20 62 65 66 | 6f 72 65 20 74 68 69 73 |hing bef|ore this|
|00000300| 20 6c 69 6e 65 2c 0a 23 | 20 74 68 65 6e 20 75 6e | line,.#| then un|
|00000310| 70 61 63 6b 20 69 74 20 | 62 79 20 73 61 76 69 6e |pack it |by savin|
|00000320| 67 20 69 74 20 69 6e 20 | 61 20 66 69 6c 65 20 61 |g it in |a file a|
|00000330| 6e 64 20 74 79 70 69 6e | 67 20 22 73 68 20 66 69 |nd typin|g "sh fi|
|00000340| 6c 65 22 2e 0a 23 0a 23 | 20 57 72 61 70 70 65 64 |le"..#.#| Wrapped|
|00000350| 20 62 79 20 6e 65 77 74 | 6f 6e 21 6f 76 65 20 6f | by newt|on!ove o|
|00000360| 6e 20 4d 6f 6e 20 44 65 | 63 20 31 35 20 32 31 3a |n Mon De|c 15 21:|
|00000370| 31 32 3a 32 36 20 43 53 | 54 20 31 39 38 36 0a 23 |12:26 CS|T 1986.#|
|00000380| 20 43 6f 6e 74 65 6e 74 | 73 3a 20 20 70 72 65 70 | Content|s: prep|
|00000390| 2e 64 6f 63 20 4d 61 6b | 65 66 69 6c 65 20 6d 61 |.doc Mak|efile ma|
|000003a0| 6b 65 6d 73 63 20 70 72 | 65 70 2e 63 20 6d 61 63 |kemsc pr|ep.c mac|
|000003b0| 72 6f 2e 63 20 76 65 63 | 2e 63 20 73 74 72 2e 63 |ro.c vec|.c str.c|
|000003c0| 0a 20 0a 65 63 68 6f 20 | 78 20 2d 20 70 72 65 70 |. .echo |x - prep|
|000003d0| 2e 64 6f 63 0a 73 65 64 | 20 27 73 2f 5e 40 2f 2f |.doc.sed| 's/^@//|
|000003e0| 27 20 3e 20 22 70 72 65 | 70 2e 64 6f 63 22 20 3c |' > "pre|p.doc" <|
|000003f0| 3c 27 40 2f 2f 45 2a 4f | 2a 46 20 70 72 65 70 2e |<'@//E*O|*F prep.|
|00000400| 64 6f 63 2f 2f 27 0a 20 | 20 20 20 20 20 20 20 20 |doc//'. | |
|00000410| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000420| 20 20 20 20 50 52 45 50 | 20 76 2e 20 32 2e 30 0a | PREP| v. 2.0.|
|00000430| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00000440| 20 20 20 20 20 43 6f 70 | 79 72 69 67 68 74 20 28 | Cop|yright (|
|00000450| 43 29 20 31 39 38 35 2c | 31 39 38 36 20 50 2e 52 |C) 1985,|1986 P.R|
|00000460| 2e 4f 76 65 0a 20 20 20 | 20 20 20 20 20 20 20 20 |.Ove. | |
|00000470| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 41 | | A|
|00000480| 6c 6c 20 72 69 67 68 74 | 73 20 72 65 73 65 72 76 |ll right|s reserv|
|00000490| 65 64 2e 0a 0a 20 20 20 | 20 20 53 75 67 67 65 73 |ed... | Sugges|
|000004a0| 74 69 6f 6e 73 20 61 6e | 64 20 63 6f 6d 6d 65 6e |tions an|d commen|
|000004b0| 74 73 20 72 65 67 61 72 | 64 69 6e 67 20 74 68 69 |ts regar|ding thi|
|000004c0| 73 20 70 72 6f 67 72 61 | 6d 20 61 72 65 20 77 65 |s progra|m are we|
|000004d0| 6c 63 6f 6d 65 2c 0a 70 | 72 65 66 65 72 61 62 6c |lcome,.p|referabl|
|000004e0| 79 20 69 6e 20 74 68 65 | 20 66 6f 72 6d 20 6f 66 |y in the| form of|
|000004f0| 20 63 6f 64 65 20 73 65 | 67 6d 65 6e 74 73 2e 20 | code se|gments. |
|00000500| 20 49 20 77 69 6c 6c 20 | 6d 61 6b 65 20 61 6e 20 | I will |make an |
|00000510| 65 66 66 6f 72 74 20 74 | 6f 0a 69 6e 63 6f 72 70 |effort t|o.incorp|
|00000520| 6f 72 61 74 65 20 61 6e | 79 20 73 75 67 67 65 73 |orate an|y sugges|
|00000530| 74 69 6f 6e 73 20 74 68 | 61 74 20 61 72 65 20 64 |tions th|at are d|
|00000540| 65 65 6d 65 64 20 77 6f | 72 74 68 79 20 61 6e 64 |eemed wo|rthy and|
|00000550| 20 6d 61 69 6e 74 61 69 | 6e 20 61 6e 0a 22 6f 66 | maintai|n an."of|
|00000560| 66 69 63 69 61 6c 22 20 | 76 65 72 73 69 6f 6e 20 |ficial" |version |
|00000570| 6f 66 20 74 68 69 73 20 | 70 72 6f 67 72 61 6d 20 |of this |program |
|00000580| 6f 6e 20 74 68 65 20 6e | 65 74 2e 20 20 41 74 20 |on the n|et. At |
|00000590| 74 68 65 20 6d 6f 6d 65 | 6e 74 20 63 6f 6d 6d 65 |the mome|nt comme|
|000005a0| 6e 74 73 0a 73 68 6f 75 | 6c 64 20 62 65 20 64 69 |nts.shou|ld be di|
|000005b0| 72 65 63 74 65 64 20 74 | 6f 20 31 34 30 30 34 40 |rected t|o 14004@|
|000005c0| 6e 63 73 61 76 6d 73 61 | 2e 62 69 74 6e 65 74 20 |ncsavmsa|.bitnet |
|000005d0| 28 6f 72 20 65 71 75 69 | 76 61 6c 65 6e 74 6c 79 |(or equi|valently|
|000005e0| 20 31 34 30 30 34 40 0a | 6e 63 73 61 61 2e 63 73 | 14004@.|ncsaa.cs|
|000005f0| 6f 2e 75 69 75 63 2e 65 | 64 75 29 2c 20 6f 72 20 |o.uiuc.e|du), or |
|00000600| 70 72 6f 76 65 40 75 69 | 75 63 6d 76 64 2e 62 69 |prove@ui|ucmvd.bi|
|00000610| 74 6e 65 74 2c 20 6f 72 | 20 70 72 6f 76 65 40 74 |tnet, or| prove@t|
|00000620| 63 67 6f 75 6c 64 2e 74 | 6e 2e 0a 63 6f 72 6e 65 |cgould.t|n..corne|
|00000630| 6c 6c 2e 65 64 75 2e 0a | 0a 0a 0a 49 6e 74 72 6f |ll.edu..|...Intro|
|00000640| 64 75 63 74 69 6f 6e 0a | 0a 20 20 20 20 20 54 68 |duction.|. Th|
|00000650| 69 73 20 64 6f 63 75 6d | 65 6e 74 61 74 69 6f 6e |is docum|entation|
|00000660| 20 64 65 73 63 72 69 62 | 65 73 20 74 68 65 20 75 | describ|es the u|
|00000670| 73 65 20 6f 66 20 50 52 | 45 50 2c 20 61 20 70 72 |se of PR|EP, a pr|
|00000680| 65 70 72 6f 63 65 73 73 | 6f 72 20 66 6f 72 20 0a |eprocess|or for .|
|00000690| 66 6f 72 74 72 61 6e 2e | 20 20 41 73 20 61 6e 20 |fortran.| As an |
|000006a0| 61 6c 74 65 72 6e 61 74 | 69 76 65 20 74 6f 20 72 |alternat|ive to r|
|000006b0| 61 74 66 6f 72 2c 20 50 | 52 45 50 20 6f 66 66 65 |atfor, P|REP offe|
|000006c0| 72 73 20 73 6f 6d 65 20 | 64 69 73 74 69 6e 63 74 |rs some |distinct|
|000006d0| 20 61 64 76 61 6e 74 61 | 67 65 73 2e 0a 54 68 65 | advanta|ges..The|
|000006e0| 73 65 20 69 6e 63 6c 75 | 64 65 20 66 75 6c 6c 20 |se inclu|de full |
|000006f0| 6d 61 63 72 6f 20 66 61 | 63 69 6c 69 74 69 65 73 |macro fa|cilities|
|00000700| 20 61 6e 64 20 61 20 63 | 6f 6e 63 69 73 65 20 73 | and a c|oncise s|
|00000710| 68 6f 72 74 68 61 6e 64 | 20 66 6f 72 20 61 72 72 |horthand| for arr|
|00000720| 61 79 0a 61 6e 64 20 76 | 65 63 74 6f 72 20 73 74 |ay.and v|ector st|
|00000730| 61 74 65 6d 65 6e 74 73 | 2e 20 20 49 6e 20 61 64 |atements|. In ad|
|00000740| 64 69 74 69 6f 6e 2c 20 | 61 6c 6c 20 6f 66 20 74 |dition, |all of t|
|00000750| 68 65 20 73 74 61 6e 64 | 61 72 64 20 66 6c 6f 77 |he stand|ard flow|
|00000760| 20 63 6f 6e 74 72 6f 6c | 0a 63 6f 6e 73 74 72 75 | control|.constru|
|00000770| 63 74 73 20 6f 66 20 66 | 6f 72 74 68 20 61 72 65 |cts of f|orth are|
|00000780| 20 73 75 70 70 6f 72 74 | 65 64 2e 20 20 53 6f 6d | support|ed. Som|
|00000790| 65 20 61 74 74 65 6d 70 | 74 73 20 68 61 76 65 20 |e attemp|ts have |
|000007a0| 62 65 65 6e 20 6d 61 64 | 65 20 74 6f 0a 61 76 6f |been mad|e to.avo|
|000007b0| 69 64 20 72 61 74 66 6f | 72 20 73 79 6e 74 61 78 |id ratfo|r syntax|
|000007c0| 20 74 6f 20 74 68 61 74 | 20 62 6f 74 68 20 70 72 | to that| both pr|
|000007d0| 65 70 72 6f 63 65 73 73 | 6f 72 73 20 63 61 6e 20 |eprocess|ors can |
|000007e0| 62 65 20 75 73 65 64 2c | 20 62 75 74 20 74 68 69 |be used,| but thi|
|000007f0| 73 0a 68 61 73 20 6e 65 | 76 65 72 20 62 65 65 6e |s.has ne|ver been|
|00000800| 20 63 68 65 63 6b 65 64 | 20 66 75 6c 6c 79 2e 20 | checked| fully. |
|00000810| 20 49 74 20 69 73 20 70 | 72 6f 62 61 62 6c 79 20 | It is p|robably |
|00000820| 70 6f 73 73 69 62 6c 65 | 20 74 6f 20 65 6d 75 6c |possible| to emul|
|00000830| 61 74 65 20 6d 75 63 68 | 20 6f 66 0a 72 61 74 66 |ate much| of.ratf|
|00000840| 6f 72 27 73 20 73 79 6e | 74 61 78 20 75 73 69 6e |or's syn|tax usin|
|00000850| 67 20 50 52 45 50 27 73 | 20 6d 61 63 72 6f 20 70 |g PREP's| macro p|
|00000860| 72 6f 63 65 73 73 6f 72 | 20 74 6f 20 6d 6f 64 69 |rocessor| to modi|
|00000870| 66 79 20 74 68 65 20 66 | 6c 6f 77 20 63 6f 6e 74 |fy the f|low cont|
|00000880| 72 6f 6c 0a 63 6f 6d 6d | 61 6e 64 73 2e 20 20 50 |rol.comm|ands. P|
|00000890| 52 45 50 20 69 73 20 77 | 72 69 74 74 65 6e 20 69 |REP is w|ritten i|
|000008a0| 73 20 67 65 6e 65 72 69 | 63 20 63 20 61 6e 64 20 |s generi|c c and |
|000008b0| 77 69 6c 6c 20 72 75 6e | 20 6f 6e 20 6e 65 61 72 |will run| on near|
|000008c0| 6c 79 20 61 6e 79 0a 6d | 61 63 68 69 6e 65 2f 63 |ly any.m|achine/c|
|000008d0| 6f 6d 70 69 6c 65 72 20 | 63 6f 6d 62 69 6e 61 74 |ompiler |combinat|
|000008e0| 69 6f 6e 2e 20 20 43 75 | 72 72 65 6e 74 6c 79 20 |ion. Cu|rrently |
|000008f0| 69 74 20 72 75 6e 73 20 | 6f 6e 20 49 42 4d 20 70 |it runs |on IBM p|
|00000900| 63 27 73 20 61 6e 64 0a | 63 6f 6d 70 61 74 69 62 |c's and.|compatib|
|00000910| 6c 65 73 2c 20 75 6e 69 | 78 20 6d 61 63 68 69 6e |les, uni|x machin|
|00000920| 65 73 2c 20 74 68 65 20 | 44 65 66 69 6e 69 63 6f |es, the |Definico|
|00000930| 6e 20 64 73 69 32 30 20 | 36 38 30 32 30 20 70 61 |n dsi20 |68020 pa|
|00000940| 72 61 73 69 74 65 20 63 | 61 72 64 20 69 6e 0a 61 |rasite c|ard in.a|
|00000950| 6e 20 49 42 4d 20 50 43 | 20 63 6f 6d 70 61 74 69 |n IBM PC| compati|
|00000960| 62 6c 65 20 6d 61 63 68 | 69 6e 65 2c 20 61 6e 64 |ble mach|ine, and|
|00000970| 20 74 68 65 20 43 72 61 | 79 20 58 4d 50 2e 0a 20 | the Cra|y XMP.. |
|00000980| 20 20 20 20 50 52 45 50 | 20 64 6f 65 73 20 6e 6f | PREP| does no|
|00000990| 74 20 64 6f 20 65 76 65 | 72 79 74 68 69 6e 67 2c |t do eve|rything,|
|000009a0| 20 61 6e 64 20 69 6e 20 | 70 61 72 74 69 63 75 6c | and in |particul|
|000009b0| 61 72 20 64 6f 65 73 20 | 6e 6f 74 20 6f 66 66 65 |ar does |not offe|
|000009c0| 72 20 61 6e 79 0a 68 65 | 6c 70 20 77 69 74 68 20 |r any.he|lp with |
|000009d0| 74 68 65 20 64 65 66 69 | 63 69 65 6e 63 79 20 6f |the defi|ciency o|
|000009e0| 66 20 64 61 74 61 20 73 | 74 72 75 63 74 75 72 65 |f data s|tructure|
|000009f0| 73 20 69 6e 20 66 6f 72 | 74 72 61 6e 2e 20 20 49 |s in for|tran. I|
|00000a00| 74 20 61 6c 73 6f 20 64 | 6f 65 73 20 6e 6f 74 0a |t also d|oes not.|
|00000a10| 75 6e 64 65 72 73 74 61 | 6e 64 20 66 6f 72 74 72 |understa|nd fortr|
|00000a20| 61 6e 2c 20 61 6e 64 20 | 77 69 6c 6c 20 71 75 69 |an, and |will qui|
|00000a30| 74 65 20 68 61 70 70 69 | 6c 79 20 70 72 6f 64 75 |te happi|ly produ|
|00000a40| 63 65 20 6e 6f 6e 73 65 | 6e 73 65 20 63 6f 64 65 |ce nonse|nse code|
|00000a50| 20 69 66 20 73 6f 0a 69 | 6e 73 74 72 75 63 74 65 | if so.i|nstructe|
|00000a60| 64 2e 20 20 49 74 20 77 | 69 6c 6c 20 64 65 74 65 |d. It w|ill dete|
|00000a70| 63 74 20 65 72 72 6f 72 | 73 20 69 6e 20 69 74 73 |ct error|s in its|
|00000a80| 20 6f 77 6e 20 73 79 6e | 74 61 78 2c 20 62 75 74 | own syn|tax, but|
|00000a90| 20 65 72 72 6f 72 73 20 | 69 6e 20 0a 66 6f 72 74 | errors |in .fort|
|00000aa0| 72 61 6e 20 77 69 6c 6c | 20 62 65 20 6c 65 66 74 |ran will| be left|
|00000ab0| 20 66 6f 72 20 74 68 65 | 20 63 6f 6d 70 69 6c 65 | for the| compile|
|00000ac0| 72 2e 20 20 54 68 65 72 | 65 66 6f 72 65 20 64 65 |r. Ther|efore de|
|00000ad0| 62 75 67 67 69 6e 67 20 | 77 69 6c 6c 20 0a 75 6e |bugging |will .un|
|00000ae0| 66 6f 72 74 75 6e 61 74 | 65 6c 79 20 69 6e 76 6f |fortunat|ely invo|
|00000af0| 6c 76 65 20 6c 6f 6f 6b | 69 6e 67 20 61 74 20 74 |lve look|ing at t|
|00000b00| 68 65 20 66 6f 72 74 72 | 61 6e 20 6f 75 74 70 75 |he fortr|an outpu|
|00000b10| 74 2c 20 77 68 69 63 68 | 20 63 61 6e 20 62 65 20 |t, which| can be |
|00000b20| 71 75 69 74 65 0a 75 67 | 6c 79 2e 20 20 54 68 65 |quite.ug|ly. The|
|00000b30| 73 65 20 70 72 6f 62 6c | 65 6d 73 20 61 72 65 20 |se probl|ems are |
|00000b40| 73 68 61 72 65 64 20 77 | 69 74 68 20 72 61 74 66 |shared w|ith ratf|
|00000b50| 6f 72 2e 0a 20 20 20 20 | 20 54 68 65 20 76 65 63 |or.. | The vec|
|00000b60| 74 6f 72 20 73 74 61 74 | 65 6d 65 6e 74 20 6e 6f |tor stat|ement no|
|00000b70| 74 61 74 69 6f 6e 20 6d | 61 6b 65 73 20 69 74 20 |tation m|akes it |
|00000b80| 70 6f 73 73 69 62 6c 65 | 20 74 6f 20 69 6e 63 6f |possible| to inco|
|00000b90| 72 70 6f 72 61 74 65 20 | 64 6f 0a 6c 6f 6f 70 20 |rporate |do.loop |
|00000ba0| 75 6e 72 6f 6c 6c 69 6e | 67 20 61 75 74 6f 6d 61 |unrollin|g automa|
|00000bb0| 74 69 63 61 6c 6c 79 20 | 74 6f 20 61 6e 79 20 64 |tically |to any d|
|00000bc0| 65 70 74 68 2c 20 77 68 | 69 63 68 20 66 6f 72 20 |epth, wh|ich for |
|00000bd0| 63 65 72 74 61 69 6e 20 | 63 6c 61 73 73 65 73 20 |certain |classes |
|00000be0| 6f 66 0a 6c 6f 6f 70 73 | 20 6f 6e 20 63 65 72 74 |of.loops| on cert|
|00000bf0| 61 69 6e 20 6d 61 63 68 | 69 6e 65 73 20 28 6d 65 |ain mach|ines (me|
|00000c00| 6d 6f 72 79 20 62 6f 75 | 6e 64 20 6c 6f 6f 70 73 |mory bou|nd loops|
|00000c10| 20 6f 6e 20 76 65 63 74 | 6f 72 20 6d 61 63 68 69 | on vect|or machi|
|00000c20| 6e 65 73 29 20 77 69 6c | 6c 0a 69 6d 70 72 6f 76 |nes) wil|l.improv|
|00000c30| 65 20 70 65 72 66 6f 72 | 6d 61 6e 63 65 2e 20 20 |e perfor|mance. |
|00000c40| 4f 6e 20 74 68 65 20 43 | 72 61 79 20 58 4d 50 20 |On the C|ray XMP |
|00000c50| 70 65 72 66 6f 72 6d 61 | 6e 63 65 20 66 6f 72 20 |performa|nce for |
|00000c60| 63 65 72 74 61 69 6e 20 | 6c 6f 6f 70 73 0a 77 61 |certain |loops.wa|
|00000c70| 73 20 69 6e 63 72 65 61 | 73 65 64 20 66 72 6f 6d |s increa|sed from|
|00000c80| 20 74 68 65 20 6e 6f 72 | 6d 61 6c 20 35 30 20 4d | the nor|mal 50 M|
|00000c90| 66 6c 6f 70 73 20 74 6f | 20 61 20 6d 61 78 69 6d |flops to| a maxim|
|00000ca0| 75 6d 20 6f 66 20 38 30 | 20 4d 66 6c 6f 70 73 20 |um of 80| Mflops |
|00000cb0| 77 68 65 6e 0a 75 6e 72 | 6f 6c 6c 65 64 20 74 6f |when.unr|olled to|
|00000cc0| 20 61 20 64 65 70 74 68 | 20 6f 66 20 31 36 2e 20 | a depth| of 16. |
|00000cd0| 20 4f 6e 20 6d 61 63 68 | 69 6e 65 73 20 77 69 74 | On mach|ines wit|
|00000ce0| 68 20 6d 61 6e 79 20 70 | 61 72 61 6c 6c 65 6c 20 |h many p|arallel |
|00000cf0| 70 61 74 68 73 20 74 6f | 0a 6d 65 6d 6f 72 79 20 |paths to|.memory |
|00000d00| 74 68 65 72 65 20 6d 61 | 79 20 61 6c 73 6f 20 62 |there ma|y also b|
|00000d10| 65 20 73 69 74 75 61 74 | 69 6f 6e 73 20 77 68 65 |e situat|ions whe|
|00000d20| 72 65 20 74 68 69 73 20 | 69 73 20 61 64 76 61 6e |re this |is advan|
|00000d30| 74 61 67 65 6f 75 73 2e | 0a 20 20 20 20 20 41 6c |tageous.|. Al|
|00000d40| 74 68 6f 75 67 68 20 74 | 68 65 20 73 79 6e 74 61 |though t|he synta|
|00000d50| 78 20 69 73 20 73 69 6d | 69 6c 61 72 20 74 6f 20 |x is sim|ilar to |
|00000d60| 66 6f 72 74 68 2c 20 74 | 68 65 20 73 70 69 72 69 |forth, t|he spiri|
|00000d70| 74 20 6f 66 20 66 6f 72 | 74 68 20 69 73 0a 74 6f |t of for|th is.to|
|00000d80| 74 61 6c 6c 79 20 61 62 | 73 65 6e 74 2e 20 20 54 |tally ab|sent. T|
|00000d90| 68 65 20 6d 61 63 72 6f | 73 20 61 72 65 20 72 65 |he macro|s are re|
|00000da0| 61 6c 6c 79 20 6d 61 63 | 72 6f 73 2c 20 6e 6f 74 |ally mac|ros, not|
|00000db0| 20 63 6f 6c 6f 6e 20 64 | 65 66 69 6e 69 74 69 6f | colon d|efinitio|
|00000dc0| 6e 73 2c 0a 61 6e 64 20 | 72 65 63 75 72 73 69 76 |ns,.and |recursiv|
|00000dd0| 65 20 6d 61 63 72 6f 20 | 64 65 66 69 6e 69 74 69 |e macro |definiti|
|00000de0| 6f 6e 73 20 77 69 6c 6c | 20 63 61 75 73 65 20 61 |ons will| cause a|
|00000df0| 6e 20 65 72 72 6f 72 20 | 64 75 72 69 6e 67 20 65 |n error |during e|
|00000e00| 78 70 61 6e 73 69 6f 6e | 2e 0a 50 6f 73 74 66 69 |xpansion|..Postfi|
|00000e10| 78 20 6e 6f 74 61 74 69 | 6f 6e 20 77 6f 75 6c 64 |x notati|on would|
|00000e20| 20 6f 6e 6c 79 20 63 61 | 75 73 65 20 63 6f 6e 66 | only ca|use conf|
|00000e30| 75 73 69 6f 6e 2c 20 62 | 65 69 6e 67 20 69 6e 20 |usion, b|eing in |
|00000e40| 63 6f 6e 66 6c 69 63 74 | 20 77 69 74 68 0a 66 6f |conflict| with.fo|
|00000e50| 72 74 72 61 6e 20 63 6f | 6e 76 65 6e 74 69 6f 6e |rtran co|nvention|
|00000e60| 73 2c 20 61 6e 64 20 69 | 73 20 6e 6f 74 20 75 73 |s, and i|s not us|
|00000e70| 65 64 2e 0a 20 20 20 20 | 54 68 65 20 6d 61 63 72 |ed.. |The macr|
|00000e80| 6f 20 70 72 6f 63 65 73 | 73 6f 72 20 63 61 6e 20 |o proces|sor can |
|00000e90| 62 65 20 63 6f 6e 73 69 | 64 65 72 65 64 20 61 20 |be consi|dered a |
|00000ea0| 70 72 65 2d 70 72 65 70 | 72 6f 63 65 73 73 6f 72 |pre-prep|rocessor|
|00000eb0| 2e 20 20 54 68 65 0a 6f | 72 64 65 72 20 6f 66 20 |. The.o|rder of |
|00000ec0| 74 72 61 6e 73 6c 61 74 | 69 6f 6e 20 69 73 3a 0a |translat|ion is:.|
|00000ed0| 0a 09 31 29 20 66 69 6c | 65 20 69 6e 63 6c 75 73 |..1) fil|e inclus|
|00000ee0| 69 6f 6e 0a 09 32 29 20 | 6d 61 63 72 6f 20 70 72 |ion..2) |macro pr|
|00000ef0| 6f 63 65 73 73 69 6e 67 | 0a 09 33 29 20 66 6c 6f |ocessing|..3) flo|
|00000f00| 77 20 63 6f 6e 74 72 6f | 6c 20 65 78 74 65 6e 73 |w contro|l extens|
|00000f10| 69 6f 6e 73 0a 09 34 29 | 20 76 65 63 74 6f 72 20 |ions..4)| vector |
|00000f20| 73 74 61 74 65 6d 65 6e | 74 73 0a 0a 4e 6f 74 65 |statemen|ts..Note|
|00000f30| 20 74 68 61 74 20 62 65 | 63 61 75 73 65 20 6f 66 | that be|cause of|
|00000f40| 20 74 68 69 73 20 74 68 | 65 20 66 6c 6f 77 20 63 | this th|e flow c|
|00000f50| 6f 6e 74 72 6f 6c 20 73 | 79 6e 74 61 78 20 63 61 |ontrol s|yntax ca|
|00000f60| 6e 20 62 65 20 6d 6f 64 | 69 66 69 65 64 0a 61 74 |n be mod|ified.at|
|00000f70| 20 74 68 65 20 6d 61 63 | 72 6f 20 6c 65 76 65 6c | the mac|ro level|
|00000f80| 2e 20 20 41 6c 74 68 6f | 75 67 68 20 74 68 69 73 |. Altho|ugh this|
|00000f90| 20 6f 72 64 65 72 20 6f | 66 20 74 72 61 6e 73 6c | order o|f transl|
|00000fa0| 61 74 69 6f 6e 20 68 6f | 6c 64 73 0a 72 69 67 6f |ation ho|lds.rigo|
|00000fb0| 72 6f 75 73 6c 79 2c 20 | 50 52 45 50 20 69 73 20 |rously, |PREP is |
|00000fc0| 61 20 6f 6e 65 20 70 61 | 73 73 20 70 72 6f 63 65 |a one pa|ss proce|
|00000fd0| 73 73 6f 72 20 61 6e 64 | 20 6d 61 6b 65 73 20 6e |ssor and| makes n|
|00000fe0| 6f 20 74 65 6d 70 6f 72 | 61 72 79 0a 66 69 6c 65 |o tempor|ary.file|
|00000ff0| 73 2e 0a 20 20 20 20 20 | 4d 61 63 72 6f 20 64 65 |s.. |Macro de|
|00001000| 66 69 6e 69 74 69 6f 6e | 73 20 63 61 6e 20 62 65 |finition|s can be|
|00001010| 20 69 6d 62 65 64 64 65 | 64 20 69 6e 20 74 68 65 | imbedde|d in the|
|00001020| 20 70 72 6f 67 72 61 6d | 20 66 69 6c 65 20 6f 72 | program| file or|
|00001030| 20 69 6e 0a 66 69 6c 65 | 73 20 74 68 61 74 20 63 | in.file|s that c|
|00001040| 61 6e 20 6c 61 74 65 72 | 20 62 65 20 69 6e 63 6c |an later| be incl|
|00001050| 75 64 65 64 2e 20 20 53 | 6f 6d 65 20 63 6f 6d 6d |uded. S|ome comm|
|00001060| 6f 6e 20 64 65 66 69 6e | 69 74 69 6f 6e 73 20 6d |on defin|itions m|
|00001070| 61 70 70 69 6e 67 0a 63 | 65 72 74 61 69 6e 20 73 |apping.c|ertain s|
|00001080| 79 6d 62 6f 6c 73 20 28 | 20 26 2c 20 3c 3d 2c 20 |ymbols (| &, <=, |
|00001090| 21 3d 2c 20 65 74 63 20 | 29 20 74 6f 20 74 68 65 |!=, etc |) to the|
|000010a0| 69 72 20 66 6f 72 74 72 | 61 6e 20 65 71 75 69 76 |ir fortr|an equiv|
|000010b0| 61 6c 65 6e 74 73 20 28 | 20 2e 61 6e 64 2e 2c 0a |alents (| .and.,.|
|000010c0| 40 2e 6c 65 2e 2c 20 2e | 6e 65 2e 2c 20 65 74 63 |@.le., .|ne., etc|
|000010d0| 20 29 20 61 72 65 20 73 | 74 6f 72 65 64 20 69 6e | ) are s|tored in|
|000010e0| 20 74 68 65 20 66 69 6c | 65 20 70 72 65 70 6d 61 | the fil|e prepma|
|000010f0| 63 2e 68 2e 20 20 54 68 | 65 73 65 20 63 61 6e 20 |c.h. Th|ese can |
|00001100| 62 65 20 6d 61 64 65 0a | 61 63 74 69 76 65 20 62 |be made.|active b|
|00001110| 79 20 70 6c 61 63 69 6e | 67 20 74 68 65 20 73 74 |y placin|g the st|
|00001120| 61 74 65 6d 65 6e 74 20 | 27 20 23 69 6e 63 6c 75 |atement |' #inclu|
|00001130| 64 65 20 22 70 72 65 70 | 6d 61 63 2e 68 22 20 27 |de "prep|mac.h" '|
|00001140| 20 69 6e 20 74 68 65 20 | 70 72 6f 67 72 61 6d 0a | in the |program.|
|00001150| 66 69 6c 65 2c 20 6f 72 | 20 62 79 20 75 73 69 6e |file, or| by usin|
|00001160| 67 20 74 68 65 20 2d 69 | 20 73 77 69 74 63 68 20 |g the -i| switch |
|00001170| 66 72 6f 6d 20 74 68 65 | 20 63 6f 6d 6d 61 6e 64 |from the| command|
|00001180| 20 6c 69 6e 65 2e 0a 20 | 20 20 20 54 68 65 20 6e | line.. | The n|
|00001190| 65 73 74 69 6e 67 20 6c | 69 6d 69 74 20 66 6f 72 |esting l|imit for|
|000011a0| 20 61 6c 6c 20 6c 6f 6f | 70 73 20 69 73 20 64 65 | all loo|ps is de|
|000011b0| 66 69 6e 65 64 20 62 79 | 20 61 6e 20 69 6e 74 65 |fined by| an inte|
|000011c0| 72 6e 61 6c 20 63 6f 6e | 73 74 61 6e 74 0a 4e 45 |rnal con|stant.NE|
|000011d0| 53 54 49 4e 47 2c 20 77 | 68 69 63 68 20 69 73 20 |STING, w|hich is |
|000011e0| 73 65 74 20 74 6f 20 61 | 20 6e 75 6d 62 65 72 20 |set to a| number |
|000011f0| 6c 69 6b 65 20 31 30 20 | 6f 72 20 32 30 20 28 69 |like 10 |or 20 (i|
|00001200| 6d 70 6c 65 6d 65 6e 74 | 61 74 69 6f 6e 20 0a 64 |mplement|ation .d|
|00001210| 65 70 65 6e 64 65 6e 74 | 29 2e 20 20 54 68 65 20 |ependent|). The |
|00001220| 66 6c 6f 77 20 63 6f 6e | 74 72 6f 6c 20 64 69 72 |flow con|trol dir|
|00001230| 65 63 74 69 76 65 73 20 | 61 72 65 20 70 65 72 6d |ectives |are perm|
|00001240| 69 74 74 65 64 20 69 6e | 73 69 64 65 20 76 65 63 |itted in|side vec|
|00001250| 74 6f 72 0a 6c 6f 6f 70 | 73 2c 20 62 75 74 20 73 |tor.loop|s, but s|
|00001260| 69 6e 63 65 20 74 68 65 | 79 20 77 69 6c 6c 20 69 |ince the|y will i|
|00001270| 6e 68 69 62 69 74 20 43 | 72 61 79 20 76 65 63 74 |nhibit C|ray vect|
|00001280| 6f 72 69 7a 61 74 69 6f | 6e 20 6f 66 20 74 68 6f |orizatio|n of tho|
|00001290| 73 65 20 6c 6f 6f 70 73 | 20 69 74 0a 6d 61 79 20 |se loops| it.may |
|000012a0| 62 65 20 62 65 73 74 20 | 74 6f 20 61 76 6f 69 64 |be best |to avoid|
|000012b0| 20 74 68 69 73 2e 20 20 | 4f 6e 65 20 6f 66 20 74 | this. |One of t|
|000012c0| 68 65 20 72 65 61 73 6f | 6e 73 20 66 6f 72 20 75 |he reaso|ns for u|
|000012d0| 73 69 6e 67 20 74 68 65 | 20 76 65 63 74 6f 72 0a |sing the| vector.|
|000012e0| 73 68 6f 72 74 68 61 6e | 64 20 69 73 20 74 68 61 |shorthan|d is tha|
|000012f0| 74 20 69 74 20 65 6e 63 | 6f 75 72 61 67 65 73 20 |t it enc|ourages |
|00001300| 70 72 6f 67 72 61 6d 6d | 69 6e 67 20 69 6e 20 61 |programm|ing in a|
|00001310| 20 73 74 79 6c 65 20 74 | 68 61 74 20 63 61 6e 20 | style t|hat can |
|00001320| 62 65 0a 65 61 73 69 6c | 79 20 76 65 63 74 6f 72 |be.easil|y vector|
|00001330| 69 7a 65 64 20 62 79 20 | 74 68 65 20 63 6f 6d 70 |ized by |the comp|
|00001340| 69 6c 65 72 2e 0a 20 20 | 20 20 54 68 69 73 20 70 |iler.. | This p|
|00001350| 72 6f 67 72 61 6d 20 61 | 74 74 65 6d 70 74 73 20 |rogram a|ttempts |
|00001360| 74 6f 20 61 76 6f 69 64 | 20 61 6c 6c 20 66 69 78 |to avoid| all fix|
|00001370| 65 64 20 6c 69 6d 69 74 | 73 20 6f 6e 20 64 61 74 |ed limit|s on dat|
|00001380| 61 20 73 74 72 75 63 74 | 75 72 65 73 2c 0a 61 6e |a struct|ures,.an|
|00001390| 64 20 69 6e 73 74 65 61 | 64 20 61 6c 6c 6f 63 61 |d instea|d alloca|
|000013a0| 74 65 73 20 6d 65 6d 6f | 72 79 20 77 68 65 6e 20 |tes memo|ry when |
|000013b0| 6e 65 65 64 65 64 2e 20 | 20 54 68 65 20 66 6c 6f |needed. | The flo|
|000013c0| 77 20 63 6f 6e 74 72 6f | 6c 20 64 69 72 65 63 74 |w contro|l direct|
|000013d0| 69 76 65 73 0a 64 6f 20 | 6e 6f 74 20 61 64 68 65 |ives.do |not adhe|
|000013e0| 72 65 20 74 6f 20 74 68 | 69 73 20 70 68 69 6c 6f |re to th|is philo|
|000013f0| 73 6f 70 68 79 2c 20 73 | 69 6e 63 65 20 74 68 65 |sophy, s|ince the|
|00001400| 20 6d 61 78 69 6d 75 6d | 20 65 78 70 61 6e 73 69 | maximum| expansi|
|00001410| 6f 6e 20 6c 65 6e 67 74 | 68 0a 63 61 6e 20 62 65 |on lengt|h.can be|
|00001420| 20 64 65 74 65 72 6d 69 | 6e 65 64 20 69 6e 20 61 | determi|ned in a|
|00001430| 64 76 61 6e 63 65 20 61 | 6e 64 20 70 72 6f 63 65 |dvance a|nd proce|
|00001440| 73 73 69 6e 67 20 69 73 | 20 66 61 73 74 65 72 20 |ssing is| faster |
|00001450| 77 69 74 68 6f 75 74 20 | 63 6f 6e 74 69 6e 75 61 |without |continua|
|00001460| 6c 0a 72 65 61 6c 6c 6f | 63 61 74 69 6f 6e 20 6f |l.reallo|cation o|
|00001470| 66 20 6d 65 6d 6f 72 79 | 2e 20 20 46 61 69 72 6c |f memory|. Fairl|
|00001480| 79 20 72 6f 62 75 73 74 | 20 6d 65 6d 6f 72 79 20 |y robust| memory |
|00001490| 6d 61 6e 61 67 65 6d 65 | 6e 74 20 69 73 20 75 73 |manageme|nt is us|
|000014a0| 65 64 20 62 79 20 74 68 | 65 0a 6d 61 63 72 6f 20 |ed by th|e.macro |
|000014b0| 70 72 6f 63 65 73 73 6f | 72 20 61 6e 64 20 69 6e |processo|r and in|
|000014c0| 70 75 74 20 72 6f 75 74 | 69 6e 65 73 20 28 74 68 |put rout|ines (th|
|000014d0| 65 72 65 20 69 73 20 6e | 6f 20 73 6f 75 72 63 65 |ere is n|o source|
|000014e0| 20 6c 69 6e 65 20 6c 65 | 6e 67 74 68 20 6c 69 6d | line le|ngth lim|
|000014f0| 69 74 0a 6f 74 68 65 72 | 20 74 68 61 6e 20 61 6e |it.other| than an|
|00001500| 79 20 6c 69 6d 69 74 61 | 74 69 6f 6e 73 20 69 6d |y limita|tions im|
|00001510| 70 6f 73 65 64 20 62 79 | 20 74 68 65 20 73 79 73 |posed by| the sys|
|00001520| 74 65 6d 29 2e 20 20 52 | 65 63 75 72 73 69 76 65 |tem). R|ecursive|
|00001530| 20 6d 61 63 72 6f 0a 64 | 65 66 69 6e 69 74 69 6f | macro.d|efinitio|
|00001540| 6e 73 20 61 72 65 20 61 | 63 63 65 70 74 65 64 20 |ns are a|ccepted |
|00001550| 64 75 72 69 6e 67 20 74 | 68 65 20 64 65 66 69 6e |during t|he defin|
|00001560| 69 74 69 6f 6e 20 70 68 | 61 73 65 2c 20 62 75 74 |ition ph|ase, but|
|00001570| 20 77 69 6c 6c 20 63 61 | 75 73 65 20 61 6e 0a 65 | will ca|use an.e|
|00001580| 72 72 6f 72 20 64 75 72 | 69 6e 67 20 65 78 70 61 |rror dur|ing expa|
|00001590| 6e 73 69 6f 6e 2e 20 20 | 57 68 65 6e 20 61 20 6d |nsion. |When a m|
|000015a0| 61 63 72 6f 20 69 73 20 | 65 78 70 61 6e 64 65 64 |acro is |expanded|
|000015b0| 20 6d 6f 72 65 20 74 68 | 61 6e 20 74 68 65 20 6c | more th|an the l|
|000015c0| 69 6d 69 74 0a 28 31 30 | 30 20 6f 72 20 73 6f 20 |imit.(10|0 or so |
|000015d0| 70 65 72 20 6c 69 6e 65 | 2c 20 62 75 74 20 69 6d |per line|, but im|
|000015e0| 70 6c 65 6d 65 6e 74 61 | 74 69 6f 6e 20 64 65 70 |plementa|tion dep|
|000015f0| 65 6e 64 65 6e 74 29 20 | 74 68 65 20 70 72 6f 67 |endent) |the prog|
|00001600| 72 61 6d 20 77 69 6c 6c | 20 61 62 6f 72 74 0a 77 |ram will| abort.w|
|00001610| 69 74 68 20 61 20 72 65 | 63 75 72 73 69 6f 6e 20 |ith a re|cursion |
|00001620| 65 72 72 6f 72 20 6d 65 | 73 73 61 67 65 2c 20 62 |error me|ssage, b|
|00001630| 75 74 20 69 74 20 69 73 | 20 63 6f 6e 63 65 69 76 |ut it is| conceiv|
|00001640| 61 62 6c 65 20 28 69 66 | 20 74 68 65 20 6d 65 6d |able (if| the mem|
|00001650| 6f 72 79 20 6f 66 0a 74 | 68 65 20 6d 61 63 68 69 |ory of.t|he machi|
|00001660| 6e 65 20 69 73 20 73 6d | 61 6c 6c 20 61 6e 64 20 |ne is sm|all and |
|00001670| 74 68 65 20 6d 61 63 72 | 6f 20 64 65 66 69 6e 69 |the macr|o defini|
|00001680| 74 69 6f 6e 73 20 61 72 | 65 20 76 65 72 79 20 6c |tions ar|e very l|
|00001690| 6f 6e 67 29 20 74 68 61 | 74 20 61 0a 6d 65 6d 6f |ong) tha|t a.memo|
|000016a0| 72 79 20 61 6c 6c 6f 63 | 61 74 69 6f 6e 20 65 72 |ry alloc|ation er|
|000016b0| 72 6f 72 20 77 69 6c 6c | 20 6f 63 63 75 72 20 62 |ror will| occur b|
|000016c0| 65 66 6f 72 65 20 74 68 | 69 73 2e 0a 20 20 20 20 |efore th|is.. |
|000016d0| 49 6e 20 6d 6f 73 74 20 | 63 61 73 65 73 20 74 68 |In most |cases th|
|000016e0| 65 20 66 6c 6f 77 20 63 | 6f 6e 74 72 6f 6c 20 64 |e flow c|ontrol d|
|000016f0| 69 72 65 63 74 69 76 65 | 73 20 6d 75 73 74 20 62 |irective|s must b|
|00001700| 65 20 74 68 65 20 66 69 | 72 73 74 20 77 6f 72 64 |e the fi|rst word|
|00001710| 0a 6f 6e 20 74 68 65 20 | 6c 69 6e 65 20 28 50 52 |.on the |line (PR|
|00001720| 45 50 20 69 73 20 6c 69 | 6e 65 20 6f 72 69 65 6e |EP is li|ne orien|
|00001730| 74 65 64 20 6c 69 6b 65 | 20 66 6f 72 74 72 61 6e |ted like| fortran|
|00001740| 20 61 6e 64 20 75 6e 6c | 69 6b 65 20 63 29 2e 20 | and unl|ike c). |
|00001750| 20 54 68 65 0a 6f 6e 6c | 79 20 65 78 63 65 70 74 | The.onl|y except|
|00001760| 69 6f 6e 20 69 73 20 74 | 68 61 74 20 64 69 72 65 |ion is t|hat dire|
|00001770| 63 74 69 76 65 73 20 61 | 6e 64 20 66 6f 72 74 72 |ctives a|nd fortr|
|00001780| 61 6e 20 63 6f 64 65 20 | 63 61 6e 20 62 65 20 6f |an code |can be o|
|00001790| 6e 20 74 68 65 20 73 61 | 6d 65 0a 6c 69 6e 65 20 |n the sa|me.line |
|000017a0| 61 66 74 65 72 20 61 6e | 20 4f 46 20 73 74 61 74 |after an| OF stat|
|000017b0| 65 6d 65 6e 74 2e 20 20 | 41 6e 79 20 64 65 6c 69 |ement. |Any deli|
|000017c0| 6d 69 74 65 72 73 20 28 | 29 7b 7d 5b 5d 27 22 20 |miters (|){}[]'" |
|000017d0| 6d 61 79 20 62 65 20 75 | 73 65 64 20 69 6e 20 74 |may be u|sed in t|
|000017e0| 68 65 0a 6c 6f 67 69 63 | 61 6c 20 65 78 70 72 65 |he.logic|al expre|
|000017f0| 73 73 69 6f 6e 73 20 28 | 20 69 2e 65 2e 20 20 6c |ssions (| i.e. l|
|00001800| 65 61 76 65 20 5b 20 69 | 20 3d 3d 20 31 20 5d 20 |eave [ i| == 1 ] |
|00001810| 29 2e 20 20 4d 61 63 72 | 6f 20 64 65 66 69 6e 69 |). Macr|o defini|
|00001820| 74 69 6f 6e 73 0a 6d 75 | 73 74 20 75 73 65 20 28 |tions.mu|st use (|
|00001830| 29 20 66 6f 72 20 74 68 | 65 20 70 61 72 61 6d 65 |) for th|e parame|
|00001840| 74 65 72 20 62 6c 6f 63 | 6b 20 68 6f 77 65 76 65 |ter bloc|k howeve|
|00001850| 72 20 28 74 6f 20 61 6c | 6c 6f 77 20 6d 61 63 72 |r (to al|low macr|
|00001860| 6f 20 6e 61 6d 65 73 0a | 63 6f 6e 74 61 69 6e 69 |o names.|containi|
|00001870| 6e 67 20 74 68 65 20 63 | 68 61 72 61 63 74 65 72 |ng the c|haracter|
|00001880| 20 7b 2c 20 66 6f 72 20 | 69 6e 73 74 61 6e 63 65 | {, for |instance|
|00001890| 29 2c 20 61 6e 64 20 6d | 61 63 72 6f 20 6e 61 6d |), and m|acro nam|
|000018a0| 65 73 20 63 61 6e 6e 6f | 74 20 63 6f 6e 74 61 69 |es canno|t contai|
|000018b0| 6e 0a 74 68 65 20 6f 70 | 65 6e 20 70 61 72 65 6e |n.the op|en paren|
|000018c0| 73 20 6f 72 20 77 68 69 | 74 65 73 70 61 63 65 20 |s or whi|tespace |
|000018d0| 63 68 61 72 61 63 74 65 | 72 73 2e 0a 0a 0a 52 75 |characte|rs....Ru|
|000018e0| 6e 6e 69 6e 67 20 50 52 | 45 50 0a 0a 20 20 20 20 |nning PR|EP.. |
|000018f0| 20 54 68 65 20 63 6f 6d | 6d 61 6e 64 20 6c 69 6e | The com|mand lin|
|00001900| 65 20 69 6e 74 65 72 66 | 61 63 65 20 61 6e 64 20 |e interf|ace and |
|00001910| 70 72 6f 67 72 61 6d 20 | 66 75 6e 63 74 69 6f 6e |program |function|
|00001920| 20 69 73 20 69 64 65 6e | 74 69 63 61 6c 20 0a 72 | is iden|tical .r|
|00001930| 65 67 61 72 64 6c 65 73 | 73 20 6f 66 20 74 68 65 |egardles|s of the|
|00001940| 20 6d 61 63 68 69 6e 65 | 20 28 73 6f 20 66 61 72 | machine| (so far|
|00001950| 29 2e 20 20 54 68 65 20 | 73 79 6e 74 61 78 20 69 |). The |syntax i|
|00001960| 73 0a 0a 70 72 65 70 20 | 2d 78 20 2d 78 20 2e 2e |s..prep |-x -x ..|
|00001970| 2e 2e 20 3c 66 69 6c 65 | 3e 0a 0a 77 68 65 72 65 |.. <file|>..where|
|00001980| 20 66 69 6c 65 20 69 73 | 20 74 68 65 20 66 69 72 | file is| the fir|
|00001990| 73 74 20 6e 61 6d 65 20 | 6f 66 20 74 68 65 20 66 |st name |of the f|
|000019a0| 69 6c 65 20 61 6e 64 20 | 74 68 65 20 65 78 74 65 |ile and |the exte|
|000019b0| 6e 73 69 6f 6e 20 69 73 | 20 61 73 73 75 6d 65 64 |nsion is| assumed|
|000019c0| 0a 74 6f 20 62 65 20 50 | 2e 20 20 54 68 65 20 6f |.to be P|. The o|
|000019d0| 75 74 70 75 74 20 66 69 | 6c 65 20 77 69 6c 6c 20 |utput fi|le will |
|000019e0| 68 61 76 65 20 74 68 65 | 20 65 78 74 65 6e 73 69 |have the| extensi|
|000019f0| 6f 6e 20 46 2e 20 20 78 | 20 72 65 70 72 65 73 65 |on F. x| represe|
|00001a00| 6e 74 73 0a 61 20 63 6f | 6d 6d 61 6e 64 20 6c 69 |nts.a co|mmand li|
|00001a10| 6e 65 20 6f 70 74 69 6f | 6e 3a 0a 0a 20 53 77 69 |ne optio|n:.. Swi|
|00001a20| 74 63 68 65 73 3a 0a 20 | 20 20 2d 63 09 09 6b 65 |tches:. | -c..ke|
|00001a30| 65 70 20 63 6f 6d 6d 65 | 6e 74 73 20 28 74 72 75 |ep comme|nts (tru|
|00001a40| 6e 63 61 74 65 64 20 61 | 74 20 63 6f 6c 75 6d 6e |ncated a|t column|
|00001a50| 20 37 32 29 0a 20 20 20 | 2d 75 09 09 6b 65 65 70 | 72). |-u..keep|
|00001a60| 20 75 6e 64 65 72 6c 69 | 6e 65 20 63 68 61 72 61 | underli|ne chara|
|00001a70| 63 74 65 72 73 0a 20 20 | 20 2d 6d 09 09 6f 6e 6c |cters. | -m..onl|
|00001a80| 79 20 64 6f 20 6d 61 63 | 72 6f 20 73 75 62 73 74 |y do mac|ro subst|
|00001a90| 69 74 75 74 69 6f 6e 20 | 28 3d 3d 3e 20 2d 63 20 |itution |(==> -c |
|00001aa0| 61 6e 64 20 2d 75 20 61 | 73 20 77 65 6c 6c 2c 20 |and -u a|s well, |
|00001ab0| 61 6e 64 0a 09 09 70 72 | 65 76 65 6e 74 73 20 66 |and...pr|events f|
|00001ac0| 69 6c 65 20 69 6e 63 6c | 75 64 65 73 20 28 65 78 |ile incl|udes (ex|
|00001ad0| 63 65 70 74 20 2d 69 20 | 73 77 69 74 63 68 29 2e |cept -i |switch).|
|00001ae0| 0a 20 20 20 2d 69 09 3c | 66 69 6c 65 3e 09 69 6e |. -i.<|file>.in|
|00001af0| 63 6c 75 64 65 20 3c 66 | 69 6c 65 3e 20 62 65 66 |clude <f|ile> bef|
|00001b00| 6f 72 65 20 70 72 6f 63 | 65 73 73 69 6e 67 0a 20 |ore proc|essing. |
|00001b10| 20 20 2d 55 20 6e 09 09 | 75 6e 72 6f 6c 6c 20 76 | -U n..|unroll v|
|00001b20| 65 63 74 6f 72 20 6c 6f | 6f 70 73 20 74 6f 20 64 |ector lo|ops to d|
|00001b30| 65 70 74 68 20 6e 0a 20 | 20 20 2d 4c 20 6e 09 09 |epth n. | -L n..|
|00001b40| 75 6e 72 6f 6c 6c 20 6c | 6f 6f 70 73 20 77 69 74 |unroll l|oops wit|
|00001b50| 68 20 6e 20 6f 72 20 66 | 65 77 65 72 20 6c 69 6e |h n or f|ewer lin|
|00001b60| 65 73 0a 20 20 20 2d 3f | 09 09 77 72 69 74 65 20 |es. -?|..write |
|00001b70| 6d 65 73 73 61 67 65 20 | 61 62 6f 75 74 20 61 6c |message |about al|
|00001b80| 6c 6f 77 65 64 20 73 77 | 69 74 63 68 65 73 0a 0a |lowed sw|itches..|
|00001b90| 20 20 20 20 20 49 66 20 | 6e 6f 20 66 69 6c 65 20 | If |no file |
|00001ba0| 69 73 20 70 72 65 73 65 | 6e 74 20 73 74 61 6e 64 |is prese|nt stand|
|00001bb0| 61 72 64 20 69 6e 70 75 | 74 20 61 6e 64 20 6f 75 |ard inpu|t and ou|
|00001bc0| 74 70 75 74 20 61 72 65 | 20 75 73 65 64 2e 20 20 |tput are| used. |
|00001bd0| 54 68 65 20 2d 69 0a 73 | 77 69 74 63 68 20 72 65 |The -i.s|witch re|
|00001be0| 71 75 69 72 65 73 20 74 | 68 65 20 66 75 6c 6c 20 |quires t|he full |
|00001bf0| 70 61 74 68 20 6e 61 6d | 65 20 6f 66 20 74 68 65 |path nam|e of the|
|00001c00| 20 69 6e 63 6c 75 64 65 | 20 66 69 6c 65 2e 0a 20 | include| file.. |
|00001c10| 20 20 20 20 4e 6f 72 6d | 61 6c 6c 79 20 75 6e 64 | Norm|ally und|
|00001c20| 65 72 6c 69 6e 65 20 63 | 68 61 72 61 63 74 65 72 |erline c|haracter|
|00001c30| 73 20 61 6e 64 20 63 6f | 6d 6d 65 6e 74 20 72 65 |s and co|mment re|
|00001c40| 63 6f 72 64 73 20 61 72 | 65 20 65 6c 69 6d 69 6e |cords ar|e elimin|
|00001c50| 61 74 65 64 0a 75 6e 6c | 65 73 73 20 6f 76 65 72 |ated.unl|ess over|
|00001c60| 72 69 64 64 65 6e 20 77 | 69 74 68 20 61 20 73 77 |ridden w|ith a sw|
|00001c70| 69 74 63 68 2e 20 20 51 | 75 6f 74 65 64 20 75 6e |itch. Q|uoted un|
|00001c80| 64 65 72 6c 69 6e 65 73 | 20 28 74 68 65 20 66 6f |derlines| (the fo|
|00001c90| 72 74 72 61 6e 20 71 75 | 6f 74 65 0a 63 68 61 72 |rtran qu|ote.char|
|00001ca0| 61 63 74 65 72 20 69 73 | 20 74 68 65 20 61 70 6f |acter is| the apo|
|00001cb0| 73 74 72 6f 70 68 65 29 | 20 61 72 65 20 6e 65 76 |strophe)| are nev|
|00001cc0| 65 72 20 64 65 6c 65 74 | 65 64 2e 20 20 49 6e 20 |er delet|ed. In |
|00001cd0| 67 65 6e 65 72 61 6c 20 | 71 75 6f 74 65 64 0a 63 |general |quoted.c|
|00001ce0| 68 61 72 61 63 74 65 72 | 73 20 61 72 65 20 73 61 |haracter|s are sa|
|00001cf0| 66 65 20 66 72 6f 6d 20 | 50 52 45 50 2c 20 61 73 |fe from |PREP, as|
|00001d00| 20 69 73 20 74 65 78 74 | 20 69 6e 20 63 6f 6d 6d | is text| in comm|
|00001d10| 65 6e 74 20 72 65 63 6f | 72 64 73 2e 0a 20 20 20 |ent reco|rds.. |
|00001d20| 20 20 54 68 65 20 2d 6d | 20 73 77 69 74 63 68 20 | The -m| switch |
|00001d30| 69 73 20 75 73 65 66 75 | 6c 20 66 6f 72 20 63 6f |is usefu|l for co|
|00001d40| 6e 76 65 72 74 69 6e 67 | 20 65 78 69 73 74 69 6e |nverting| existin|
|00001d50| 67 20 70 72 6f 67 72 61 | 6d 73 20 74 6f 20 50 52 |g progra|ms to PR|
|00001d60| 45 50 0a 66 6f 72 6d 61 | 74 2e 20 20 49 74 20 74 |EP.forma|t. It t|
|00001d70| 75 72 6e 73 20 6f 66 66 | 20 61 6c 6c 20 50 52 45 |urns off| all PRE|
|00001d80| 50 20 66 75 6e 63 74 69 | 6f 6e 73 20 65 78 63 65 |P functi|ons exce|
|00001d90| 70 74 20 6d 61 63 72 6f | 20 73 75 62 73 74 69 74 |pt macro| substit|
|00001da0| 75 74 69 6f 6e 2e 20 20 | 54 6f 0a 70 61 72 74 69 |ution. |To.parti|
|00001db0| 61 6c 6c 79 20 63 6f 6e | 76 65 72 74 20 61 20 66 |ally con|vert a f|
|00001dc0| 6f 72 74 72 61 6e 20 70 | 72 6f 67 72 61 6d 2c 20 |ortran p|rogram, |
|00001dd0| 65 6e 74 65 72 3a 0a 0a | 70 72 65 70 20 2d 6d 20 |enter:..|prep -m |
|00001de0| 2d 69 20 66 69 78 2e 68 | 20 3c 70 72 6f 67 2e 66 |-i fix.h| <prog.f|
|00001df0| 20 3e 70 72 6f 67 2e 70 | 0a 0a 54 68 65 20 66 69 | >prog.p|..The fi|
|00001e00| 6c 65 20 66 69 78 2e 68 | 20 63 6f 6e 74 61 69 6e |le fix.h| contain|
|00001e10| 73 20 74 68 65 20 69 6e | 76 65 72 73 65 20 64 65 |s the in|verse de|
|00001e20| 66 69 6e 69 74 69 6f 6e | 73 20 6f 66 20 70 72 65 |finition|s of pre|
|00001e30| 70 6d 61 63 2e 68 2e 20 | 20 41 20 73 69 64 65 0a |pmac.h. | A side.|
|00001e40| 65 66 66 65 63 74 20 6f | 66 20 50 52 45 50 20 6f |effect o|f PREP o|
|00001e50| 6e 20 44 4f 53 20 6d 61 | 63 68 69 6e 65 73 20 69 |n DOS ma|chines i|
|00001e60| 73 20 74 68 61 74 20 74 | 68 65 20 74 65 72 6d 69 |s that t|he termi|
|00001e70| 6e 61 74 69 6e 67 20 63 | 6f 6e 74 72 6f 6c 2d 7a |nating c|ontrol-z|
|00001e80| 20 69 73 0a 72 65 6d 6f | 76 65 64 2c 20 77 68 69 | is.remo|ved, whi|
|00001e90| 63 68 20 69 73 20 75 73 | 65 66 75 6c 20 69 66 20 |ch is us|eful if |
|00001ea0| 74 68 65 20 66 6f 72 74 | 72 61 6e 20 63 6f 64 65 |the fort|ran code|
|00001eb0| 20 69 73 20 74 6f 20 62 | 65 20 74 72 61 6e 73 66 | is to b|e transf|
|00001ec0| 65 72 72 65 64 20 74 6f | 0a 61 6e 6f 74 68 65 72 |erred to|.another|
|00001ed0| 20 6d 61 63 68 69 6e 65 | 2e 20 20 52 75 6e 6e 69 | machine|. Runni|
|00001ee0| 6e 67 20 74 68 65 20 61 | 62 6f 76 65 20 63 6f 6d |ng the a|bove com|
|00001ef0| 6d 61 6e 64 20 77 69 74 | 68 6f 75 74 20 74 68 65 |mand wit|hout the|
|00001f00| 20 2d 69 20 73 77 69 74 | 63 68 20 61 6e 64 0a 77 | -i swit|ch and.w|
|00001f10| 69 74 68 6f 75 74 20 61 | 6e 79 20 69 6e 74 65 72 |ithout a|ny inter|
|00001f20| 6e 61 6c 20 6d 61 63 72 | 6f 20 64 65 66 69 6e 69 |nal macr|o defini|
|00001f30| 74 69 6f 6e 73 2c 20 69 | 74 20 77 69 6c 6c 20 64 |tions, i|t will d|
|00001f40| 6f 20 6e 6f 74 68 69 6e | 67 20 62 75 74 20 72 65 |o nothin|g but re|
|00001f50| 6d 6f 76 65 20 74 68 65 | 0a 63 6f 6e 74 72 6f 6c |move the|.control|
|00001f60| 2d 7a 2e 0a 20 20 20 20 | 20 49 66 20 74 68 65 20 |-z.. | If the |
|00001f70| 61 72 67 75 6d 65 6e 74 | 20 66 6f 72 20 2d 55 20 |argument| for -U |
|00001f80| 69 73 20 6f 6d 69 74 74 | 65 64 20 74 68 65 20 64 |is omitt|ed the d|
|00001f90| 65 66 61 75 6c 74 20 69 | 73 20 38 2e 20 20 49 66 |efault i|s 8. If|
|00001fa0| 20 2d 55 20 69 73 20 6e | 6f 74 0a 70 72 65 73 65 | -U is n|ot.prese|
|00001fb0| 6e 74 20 74 68 65 6e 20 | 75 6e 72 6f 6c 6c 69 6e |nt then |unrollin|
|00001fc0| 67 20 77 69 6c 6c 20 6e | 6f 74 20 62 65 20 64 6f |g will n|ot be do|
|00001fd0| 6e 65 20 61 74 20 61 6c | 6c 20 75 6e 6c 65 73 73 |ne at al|l unless|
|00001fe0| 20 74 75 72 6e 65 64 20 | 6f 6e 20 62 79 20 61 6e | turned |on by an|
|00001ff0| 0a 69 6e 74 65 72 6e 61 | 6c 20 64 69 72 65 63 74 |.interna|l direct|
|00002000| 69 76 65 2e 20 20 54 68 | 65 20 63 6f 6d 6d 61 6e |ive. Th|e comman|
|00002010| 64 20 6c 69 6e 65 20 73 | 77 69 74 63 68 20 77 69 |d line s|witch wi|
|00002020| 6c 6c 20 6e 6f 74 20 6f | 76 65 72 72 69 64 65 20 |ll not o|verride |
|00002030| 69 6d 62 65 64 64 65 64 | 0a 75 6e 72 6f 6c 6c 69 |imbedded|.unrolli|
|00002040| 6e 67 20 63 6f 6d 6d 61 | 6e 64 73 2e 20 20 49 66 |ng comma|nds. If|
|00002050| 20 2d 4c 20 69 73 20 6f | 6d 69 74 74 65 64 20 74 | -L is o|mitted t|
|00002060| 68 65 20 64 65 66 61 75 | 6c 74 20 69 73 20 31 30 |he defau|lt is 10|
|00002070| 30 30 2c 20 77 68 69 6c | 65 20 69 66 20 74 68 65 |00, whil|e if the|
|00002080| 0a 61 72 67 75 6d 65 6e | 74 20 69 73 20 6f 6d 69 |.argumen|t is omi|
|00002090| 74 74 65 64 20 74 68 65 | 20 64 65 66 61 75 6c 74 |tted the| default|
|000020a0| 20 69 73 20 31 2e 0a 20 | 20 20 20 20 56 65 72 73 | is 1.. | Vers|
|000020b0| 69 6f 6e 73 20 66 6f 72 | 20 49 6e 74 65 6c 20 38 |ions for| Intel 8|
|000020c0| 30 2a 2a 2a 20 62 61 73 | 65 64 20 6d 61 63 68 69 |0*** bas|ed machi|
|000020d0| 6e 65 73 20 63 6f 6d 65 | 20 63 6f 6d 70 69 6c 65 |nes come| compile|
|000020e0| 64 20 66 6f 72 20 73 6d | 61 6c 6c 0a 61 6e 64 20 |d for sm|all.and |
|000020f0| 6c 61 72 67 65 20 6d 65 | 6d 6f 72 79 20 6d 6f 64 |large me|mory mod|
|00002100| 65 6c 73 2e 20 20 54 68 | 65 20 6c 61 72 67 65 20 |els. Th|e large |
|00002110| 6d 6f 64 65 6c 20 76 65 | 72 73 69 6f 6e 20 69 73 |model ve|rsion is|
|00002120| 20 71 75 69 74 65 20 6c | 61 72 67 65 0a 69 74 73 | quite l|arge.its|
|00002130| 65 6c 66 2e 20 20 49 74 | 20 69 73 20 6f 6e 6c 79 |elf. It| is only|
|00002140| 20 6e 65 63 65 73 73 61 | 72 79 20 74 6f 20 75 73 | necessa|ry to us|
|00002150| 65 20 74 68 65 20 6c 61 | 72 67 65 20 6d 6f 64 65 |e the la|rge mode|
|00002160| 6c 20 69 66 20 74 68 65 | 20 6d 65 6d 6f 72 79 0a |l if the| memory.|
|00002170| 69 73 20 6e 65 65 64 65 | 64 20 66 6f 72 20 6d 61 |is neede|d for ma|
|00002180| 6e 79 20 76 65 72 79 20 | 6c 6f 6e 67 20 6d 61 63 |ny very |long mac|
|00002190| 72 6f 20 64 65 66 69 6e | 69 74 69 6f 6e 73 2c 20 |ro defin|itions, |
|000021a0| 77 68 69 63 68 20 61 72 | 65 20 6d 65 6d 6f 72 79 |which ar|e memory|
|000021b0| 20 72 65 73 69 64 65 6e | 74 2e 0a 49 66 20 79 6f | residen|t..If yo|
|000021c0| 75 20 68 61 76 65 20 61 | 20 6d 65 6d 6f 72 79 20 |u have a| memory |
|000021d0| 61 6c 6c 6f 63 61 74 69 | 6f 6e 20 65 72 72 6f 72 |allocati|on error|
|000021e0| 20 77 69 74 68 20 74 68 | 65 20 73 6d 61 6c 6c 20 | with th|e small |
|000021f0| 76 65 72 73 69 6f 6e 20 | 74 72 79 20 74 68 65 0a |version |try the.|
|00002200| 6f 74 68 65 72 2e 20 20 | 54 68 65 20 6c 61 72 67 |other. |The larg|
|00002210| 65 20 6f 6e 65 20 69 73 | 20 63 61 6c 6c 65 64 20 |e one is| called |
|00002220| 62 69 67 70 72 65 70 2e | 65 78 65 2e 20 20 53 69 |bigprep.|exe. Si|
|00002230| 6e 63 65 20 49 20 61 6d | 20 6e 6f 77 20 64 69 73 |nce I am| now dis|
|00002240| 74 72 69 62 75 74 69 6e | 67 0a 74 68 65 20 73 6f |tributin|g.the so|
|00002250| 75 72 63 65 20 79 6f 75 | 20 63 61 6e 20 64 6f 20 |urce you| can do |
|00002260| 77 68 61 74 20 79 6f 75 | 72 20 77 61 6e 74 2e 0a |what you|r want..|
|00002270| 0a 0a 0a 0a 53 75 6d 6d | 61 72 79 20 6f 66 20 46 |....Summ|ary of F|
|00002280| 65 61 74 75 72 65 73 0a | 0a 20 20 20 20 54 68 65 |eatures.|. The|
|00002290| 20 65 78 74 65 6e 73 69 | 6f 6e 73 20 63 61 6e 20 | extensi|ons can |
|000022a0| 62 65 20 62 72 6f 6b 65 | 6e 20 75 70 20 69 6e 74 |be broke|n up int|
|000022b0| 6f 20 66 6f 75 72 20 63 | 6c 61 73 73 65 73 3a 20 |o four c|lasses: |
|000022c0| 31 29 20 69 6e 63 6c 75 | 64 69 6e 67 0a 66 69 6c |1) inclu|ding.fil|
|000022d0| 65 73 2c 20 32 29 20 6d | 61 63 72 6f 20 64 65 66 |es, 2) m|acro def|
|000022e0| 69 6e 69 74 69 6f 6e 2f | 65 78 70 61 6e 73 69 6f |inition/|expansio|
|000022f0| 6e 2c 20 33 29 20 66 6c | 6f 77 20 63 6f 6e 74 72 |n, 3) fl|ow contr|
|00002300| 6f 6c 20 64 69 72 65 63 | 74 69 76 65 73 2c 20 61 |ol direc|tives, a|
|00002310| 6e 64 0a 34 29 20 76 65 | 63 74 6f 72 20 6e 6f 74 |nd.4) ve|ctor not|
|00002320| 61 74 69 6f 6e 2e 20 20 | 54 68 65 73 65 20 77 69 |ation. |These wi|
|00002330| 6c 6c 20 62 65 20 64 69 | 73 63 75 73 73 65 64 20 |ll be di|scussed |
|00002340| 69 6e 20 74 68 69 73 20 | 6f 72 64 65 72 2c 20 77 |in this |order, w|
|00002350| 68 69 63 68 20 69 73 20 | 0a 61 6c 73 6f 20 74 68 |hich is |.also th|
|00002360| 65 20 6f 72 64 65 72 20 | 69 6e 20 77 68 69 63 68 |e order |in which|
|00002370| 20 74 68 65 79 20 61 72 | 65 20 70 72 6f 63 65 73 | they ar|e proces|
|00002380| 73 65 64 2e 0a 0a 0a 0a | 49 6e 63 6c 75 64 65 64 |sed.....|Included|
|00002390| 20 66 69 6c 65 73 0a 20 | 20 65 78 61 6d 70 6c 65 | files. | example|
|000023a0| 3a 0a 20 20 23 69 6e 63 | 6c 75 64 65 20 22 70 72 |:. #inc|lude "pr|
|000023b0| 65 70 6d 61 63 2e 68 22 | 0a 0a 20 20 20 20 20 4e |epmac.h"|.. N|
|000023c0| 6f 72 6d 61 6c 6c 79 20 | 66 6f 72 74 72 61 6e 20 |ormally |fortran |
|000023d0| 69 6e 63 75 64 65 73 20 | 66 69 6c 65 73 20 77 69 |incudes |files wi|
|000023e0| 74 68 20 74 68 65 20 64 | 69 72 65 63 74 69 76 65 |th the d|irective|
|000023f0| 20 22 69 6e 63 6c 75 64 | 65 22 2e 20 0a 49 6e 63 | "includ|e". .Inc|
|00002400| 69 64 65 6e 74 61 6c 6c | 79 2c 20 75 73 69 6e 67 |identall|y, using|
|00002410| 20 63 66 74 20 61 6e 64 | 20 70 72 65 63 6f 6d 70 | cft and| precomp|
|00002420| 20 6f 6e 20 61 20 63 72 | 61 79 2c 20 66 69 6c 65 | on a cr|ay, file|
|00002430| 73 20 61 72 65 20 69 6e | 63 6c 75 64 65 64 20 77 |s are in|cluded w|
|00002440| 69 74 68 0a 22 75 73 65 | 22 20 73 6f 20 69 66 20 |ith."use|" so if |
|00002450| 79 6f 75 20 61 72 65 20 | 75 73 69 6e 67 20 61 20 |you are |using a |
|00002460| 63 72 61 79 20 79 6f 75 | 20 6d 61 79 20 66 69 6e |cray you| may fin|
|00002470| 64 20 69 74 20 63 6f 6e | 76 65 6e 69 65 6e 74 20 |d it con|venient |
|00002480| 74 6f 20 64 65 66 69 6e | 65 0a 22 69 6e 63 6c 75 |to defin|e."inclu|
|00002490| 64 65 22 20 65 71 75 69 | 76 61 6c 65 6e 74 20 74 |de" equi|valent t|
|000024a0| 6f 20 22 75 73 65 22 20 | 77 69 74 68 0a 09 3a 20 |o "use" |with..: |
|000024b0| 69 6e 63 6c 75 64 65 28 | 78 29 09 75 73 65 20 78 |include(|x).use x|
|000024c0| 20 3b 0a 73 6f 20 74 68 | 61 74 20 22 69 6e 63 6c | ;.so th|at "incl|
|000024d0| 75 64 65 20 27 66 69 6c | 65 27 22 20 77 69 6c 6c |ude 'fil|e'" will|
|000024e0| 20 62 65 20 74 72 61 6e | 73 6c 61 74 65 64 20 74 | be tran|slated t|
|000024f0| 6f 20 22 75 73 65 20 66 | 69 6c 65 22 2e 20 20 50 |o "use f|ile". P|
|00002500| 72 65 70 20 77 69 6c 6c | 0a 69 6e 63 6c 75 64 65 |rep will|.include|
|00002510| 20 61 20 66 69 6c 65 20 | 69 66 20 69 74 20 66 69 | a file |if it fi|
|00002520| 6e 64 73 20 61 6e 20 69 | 6e 63 6c 75 64 65 20 64 |nds an i|nclude d|
|00002530| 69 72 65 63 74 69 76 65 | 20 28 20 23 69 6e 63 6c |irective| ( #incl|
|00002540| 75 64 65 20 22 66 69 6c | 65 22 20 29 0a 69 6e 20 |ude "fil|e" ).in |
|00002550| 74 68 65 20 73 6f 75 72 | 63 65 2c 20 6f 72 20 69 |the sour|ce, or i|
|00002560| 66 20 74 68 65 20 2d 69 | 20 73 77 69 74 63 68 20 |f the -i| switch |
|00002570| 69 73 20 75 73 65 64 20 | 66 72 6f 6d 20 74 68 65 |is used |from the|
|00002580| 20 63 6f 6d 6d 61 6e 64 | 20 6c 69 6e 65 2e 20 20 | command| line. |
|00002590| 49 6e 63 6c 75 64 65 64 | 0a 66 69 6c 65 73 20 63 |Included|.files c|
|000025a0| 61 6e 20 62 65 20 6e 65 | 73 74 65 64 20 31 30 20 |an be ne|sted 10 |
|000025b0| 64 65 65 70 2e 20 20 4f | 6e 6c 79 20 74 68 65 20 |deep. O|nly the |
|000025c0| 63 75 72 72 65 6e 74 20 | 64 69 72 65 63 74 6f 72 |current |director|
|000025d0| 79 20 69 73 20 73 65 61 | 72 63 68 65 64 2c 0a 61 |y is sea|rched,.a|
|000025e0| 6e 64 20 50 52 45 50 20 | 77 69 6c 6c 20 74 65 72 |nd PREP |will ter|
|000025f0| 6d 69 6e 61 74 65 20 69 | 66 20 74 68 65 20 66 69 |minate i|f the fi|
|00002600| 6c 65 20 69 73 20 6e 6f | 74 20 66 6f 75 6e 64 2e |le is no|t found.|
|00002610| 20 20 54 6f 20 69 6e 63 | 6c 75 64 65 20 61 20 66 | To inc|lude a f|
|00002620| 69 6c 65 20 69 6e 0a 61 | 6e 6f 74 68 65 72 20 64 |ile in.a|nother d|
|00002630| 69 72 65 63 74 6f 72 79 | 20 74 68 65 20 66 75 6c |irectory| the ful|
|00002640| 6c 20 70 61 74 68 6e 61 | 6d 65 20 6d 75 73 74 20 |l pathna|me must |
|00002650| 62 65 20 75 73 65 64 2e | 0a 0a 0a 4d 61 63 72 6f |be used.|...Macro|
|00002660| 73 0a 20 20 20 20 20 54 | 68 65 20 73 74 79 6c 65 |s. T|he style|
|00002670| 20 69 73 20 73 69 6d 69 | 6c 61 72 20 74 6f 20 74 | is simi|lar to t|
|00002680| 68 61 74 20 6f 66 20 63 | 20 23 64 65 66 69 6e 65 |hat of c| #define|
|00002690| 20 6d 61 63 72 6f 73 2c | 20 65 78 63 65 70 74 0a | macros,| except.|
|000026a0| 74 68 61 74 20 3a 20 69 | 73 20 75 73 65 64 20 69 |that : i|s used i|
|000026b0| 6e 73 74 65 61 64 20 6f | 66 20 23 64 65 66 69 6e |nstead o|f #defin|
|000026c0| 65 20 61 6e 64 20 3b 20 | 74 65 72 6d 69 6e 61 74 |e and ; |terminat|
|000026d0| 65 73 20 74 68 65 20 6d | 61 63 72 6f 2e 20 20 4e |es the m|acro. N|
|000026e0| 6f 0a 73 70 65 63 69 61 | 6c 20 63 68 61 72 61 63 |o.specia|l charac|
|000026f0| 74 65 72 20 69 73 20 6e | 65 65 64 65 64 20 74 6f |ter is n|eeded to|
|00002700| 20 63 6f 6e 74 69 6e 75 | 65 20 74 6f 20 74 68 65 | continu|e to the|
|00002710| 20 6e 65 78 74 20 6c 69 | 6e 65 2e 20 20 4e 6f 6e | next li|ne. Non|
|00002720| 2d 63 20 73 79 6e 74 61 | 78 0a 69 73 20 75 73 65 |-c synta|x.is use|
|00002730| 64 20 74 6f 20 61 6c 6c | 6f 77 20 62 6f 74 68 20 |d to all|ow both |
|00002740| 50 52 45 50 20 6d 61 63 | 72 6f 73 20 61 6e 64 20 |PREP mac|ros and |
|00002750| 63 20 70 72 65 70 72 6f | 63 65 73 73 6f 72 20 6d |c prepro|cessor m|
|00002760| 61 63 72 6f 73 20 69 6e | 20 74 68 65 0a 73 61 6d |acros in| the.sam|
|00002770| 65 20 70 72 6f 67 72 61 | 6d 2e 0a 20 20 20 20 20 |e progra|m.. |
|00002780| 52 65 63 75 72 73 69 76 | 65 20 64 65 66 69 6e 69 |Recursiv|e defini|
|00002790| 74 69 6f 6e 73 20 61 72 | 65 20 70 65 72 6d 69 74 |tions ar|e permit|
|000027a0| 74 65 64 2c 20 62 75 74 | 20 77 69 6c 6c 20 63 61 |ted, but| will ca|
|000027b0| 75 73 65 20 61 6e 20 61 | 62 6f 72 74 0a 28 61 6e |use an a|bort.(an|
|000027c0| 64 20 70 6f 73 73 69 62 | 6c 79 20 61 20 6d 65 6d |d possib|ly a mem|
|000027d0| 6f 72 79 20 61 6c 6c 6f | 63 61 74 69 6f 6e 20 65 |ory allo|cation e|
|000027e0| 72 72 6f 72 29 20 6f 6e | 20 65 78 70 61 6e 73 69 |rror) on| expansi|
|000027f0| 6f 6e 2e 20 20 46 6f 72 | 20 65 61 63 68 0a 6c 69 |on. For| each.li|
|00002800| 6e 65 20 73 75 62 6d 69 | 74 74 65 64 20 74 6f 20 |ne submi|tted to |
|00002810| 65 78 70 61 6e 64 5f 6d | 61 63 72 6f 73 2c 20 61 |expand_m|acros, a|
|00002820| 20 63 6f 75 6e 74 20 6f | 66 20 69 73 20 6b 65 70 | count o|f is kep|
|00002830| 74 20 66 6f 72 20 65 61 | 63 68 0a 73 74 6f 72 65 |t for ea|ch.store|
|00002840| 64 20 6d 61 63 72 6f 20 | 69 6e 64 69 63 61 74 69 |d macro |indicati|
|00002850| 6e 67 20 68 6f 77 20 6d | 61 6e 79 20 74 69 6d 65 |ng how m|any time|
|00002860| 73 20 69 74 20 68 61 73 | 20 62 65 65 6e 20 65 78 |s it has| been ex|
|00002870| 70 61 6e 64 65 64 20 69 | 6e 0a 74 68 65 20 63 75 |panded i|n.the cu|
|00002880| 72 72 65 6e 74 20 6c 69 | 6e 65 2e 20 20 57 68 65 |rrent li|ne. Whe|
|00002890| 6e 20 74 68 69 73 20 65 | 78 63 65 65 64 73 20 4d |n this e|xceeds M|
|000028a0| 41 58 5f 43 41 4c 4c 53 | 2c 20 74 68 65 20 70 72 |AX_CALLS|, the pr|
|000028b0| 6f 67 72 61 6d 20 0a 61 | 73 73 75 6d 65 73 20 61 |ogram .a|ssumes a|
|000028c0| 20 6d 61 63 72 6f 20 64 | 65 66 69 6e 69 74 69 6f | macro d|efinitio|
|000028d0| 6e 20 69 73 20 72 65 63 | 75 72 73 69 76 65 20 61 |n is rec|ursive a|
|000028e0| 6e 64 20 73 74 6f 70 73 | 2e 20 20 4d 61 63 72 6f |nd stops|. Macro|
|000028f0| 73 0a 61 72 65 20 65 78 | 70 61 6e 64 65 64 20 73 |s.are ex|panded s|
|00002900| 74 61 72 74 69 6e 67 20 | 77 69 74 68 20 74 68 65 |tarting |with the|
|00002910| 20 6f 6e 65 20 77 69 74 | 68 20 74 68 65 20 6c 6f | one wit|h the lo|
|00002920| 6e 67 65 73 74 20 6e 61 | 6d 65 2c 20 73 6f 20 74 |ngest na|me, so t|
|00002930| 68 61 74 0a 69 66 20 74 | 68 65 20 64 65 66 69 6e |hat.if t|he defin|
|00002940| 69 74 69 6f 6e 73 0a 0a | 20 20 20 3a 20 3e 3d 09 |itions..| : >=.|
|00002950| 09 2e 67 65 2e 20 3b 0a | 20 20 20 3a 20 3e 09 09 |..ge. ;.| : >..|
|00002960| 2e 67 74 2e 20 3b 0a 0a | 61 72 65 20 69 6e 20 65 |.gt. ;..|are in e|
|00002970| 66 66 65 63 74 2c 20 3e | 3d 20 77 69 6c 6c 20 62 |ffect, >|= will b|
|00002980| 65 20 63 68 61 6e 67 65 | 64 20 74 6f 20 2e 67 65 |e change|d to .ge|
|00002990| 2e 20 72 61 74 68 65 72 | 20 74 68 61 6e 20 2e 67 |. rather| than .g|
|000029a0| 74 2e 3d 2e 20 20 54 68 | 69 73 0a 69 73 20 6f 6e |t.=. Th|is.is on|
|000029b0| 6c 79 20 61 20 70 6f 74 | 65 6e 74 69 61 6c 20 70 |ly a pot|ential p|
|000029c0| 72 6f 62 6c 65 6d 20 77 | 68 65 6e 20 6d 61 63 72 |roblem w|hen macr|
|000029d0| 6f 20 6e 61 6d 65 73 20 | 61 72 65 20 6e 6f 74 20 |o names |are not |
|000029e0| 66 75 6c 6c 79 0a 61 6c | 70 68 61 6e 75 6d 65 72 |fully.al|phanumer|
|000029f0| 69 63 2c 20 73 69 6e 63 | 65 20 22 61 72 67 22 20 |ic, sinc|e "arg" |
|00002a00| 77 69 6c 6c 20 6e 6f 74 | 20 62 65 20 66 6c 61 67 |will not| be flag|
|00002a10| 67 65 64 20 69 66 20 22 | 72 22 20 69 73 20 64 65 |ged if "|r" is de|
|00002a20| 66 69 6e 65 64 2e 0a 54 | 68 65 20 75 6e 64 65 72 |fined..T|he under|
|00002a30| 6c 69 6e 65 20 63 68 61 | 72 61 63 74 65 72 20 69 |line cha|racter i|
|00002a40| 73 20 63 6f 6e 73 69 64 | 65 72 65 64 20 6e 6f 6e |s consid|ered non|
|00002a50| 2d 61 6c 70 68 61 6e 75 | 6d 65 72 69 63 20 68 65 |-alphanu|meric he|
|00002a60| 72 65 2c 20 66 6f 72 0a | 6e 6f 20 67 6f 6f 64 20 |re, for.|no good |
|00002a70| 72 65 61 73 6f 6e 20 61 | 6e 64 20 70 65 72 68 61 |reason a|nd perha|
|00002a80| 70 73 20 69 74 20 73 68 | 6f 75 6c 64 20 6e 6f 74 |ps it sh|ould not|
|00002a90| 20 62 65 2e 0a 0a 20 20 | 20 20 20 54 68 65 20 64 | be... | The d|
|00002aa0| 65 66 69 6e 69 74 69 6f | 6e 20 70 68 61 73 65 20 |efinitio|n phase |
|00002ab0| 69 73 20 69 6e 76 6f 6b | 65 64 20 77 68 65 6e 20 |is invok|ed when |
|00002ac0| 61 20 6c 65 61 64 69 6e | 67 20 3a 20 69 73 20 66 |a leadin|g : is f|
|00002ad0| 6f 75 6e 64 20 69 6e 0a | 74 68 65 20 72 65 63 6f |ound in.|the reco|
|00002ae0| 72 64 2e 20 20 54 65 78 | 74 20 69 73 20 74 68 65 |rd. Tex|t is the|
|00002af0| 6e 20 74 61 6b 65 6e 20 | 75 6e 74 69 6c 20 74 68 |n taken |until th|
|00002b00| 65 20 74 65 72 6d 69 6e | 61 74 69 6e 67 20 3b 20 |e termin|ating ; |
|00002b10| 69 73 20 66 6f 75 6e 64 | 2e 20 20 54 65 78 74 0a |is found|. Text.|
|00002b20| 66 6f 6c 6c 6f 77 69 6e | 67 20 74 68 65 20 3b 20 |followin|g the ; |
|00002b30| 69 73 20 69 67 6e 6f 72 | 65 64 20 28 75 6e 74 69 |is ignor|ed (unti|
|00002b40| 6c 20 74 68 65 20 6e 65 | 78 74 20 6e 65 77 6c 69 |l the ne|xt newli|
|00002b50| 6e 65 29 2e 20 20 4d 75 | 6c 74 69 2d 6c 69 6e 65 |ne). Mu|lti-line|
|00002b60| 20 6d 61 63 72 6f 73 0a | 61 72 65 20 70 65 72 6d | macros.|are perm|
|00002b70| 69 74 74 65 64 3a 20 74 | 68 65 79 20 77 69 6c 6c |itted: t|hey will|
|00002b80| 20 62 65 20 63 6f 6e 76 | 65 72 74 65 64 20 74 6f | be conv|erted to|
|00002b90| 20 61 74 20 6c 65 61 73 | 74 20 61 73 20 6d 61 6e | at leas|t as man|
|00002ba0| 79 20 6c 69 6e 65 73 20 | 69 6e 20 74 68 65 0a 66 |y lines |in the.f|
|00002bb0| 6f 72 74 72 61 6e 20 70 | 72 6f 67 72 61 6d 2e 20 |ortran p|rogram. |
|00002bc0| 20 54 68 65 20 67 65 6e | 65 72 61 6c 20 66 6f 72 | The gen|eral for|
|00002bd0| 6d 20 6f 66 20 61 20 6d | 61 63 72 6f 20 64 65 66 |m of a m|acro def|
|00002be0| 69 6e 69 74 69 6f 6e 20 | 69 73 3a 0a 0a 20 20 20 |inition |is:.. |
|00002bf0| 3a 20 6e 61 6d 65 28 20 | 70 61 72 6d 31 2c 20 70 |: name( |parm1, p|
|00002c00| 61 72 6d 32 2c 20 2e 2e | 2e 20 29 09 74 65 78 74 |arm2, ..|. ).text|
|00002c10| 20 77 69 74 68 20 70 61 | 72 61 6d 65 74 65 72 73 | with pa|rameters|
|00002c20| 0a 09 09 09 09 6d 6f 72 | 65 20 74 65 78 74 20 77 |.....mor|e text w|
|00002c30| 69 74 68 20 70 61 72 61 | 6d 65 74 65 72 73 0a 09 |ith para|meters..|
|00002c40| 09 09 09 20 22 20 20 20 | 20 22 20 20 20 20 22 20 |... " | " " |
|00002c50| 20 20 20 22 20 20 20 20 | 3b 0a 0a 77 69 74 68 20 | " |;..with |
|00002c60| 32 30 20 61 73 20 74 68 | 65 20 6d 61 78 69 6d 75 |20 as th|e maximu|
|00002c70| 6d 20 6e 75 6d 62 65 72 | 20 6f 66 20 70 61 72 61 |m number| of para|
|00002c80| 6d 65 74 65 72 73 2e 20 | 20 54 68 65 72 65 20 6d |meters. | There m|
|00002c90| 75 73 74 20 62 65 20 6e | 6f 20 73 70 61 63 65 0a |ust be n|o space.|
|00002ca0| 62 65 74 77 65 65 6e 20 | 74 68 65 20 6d 61 63 72 |between |the macr|
|00002cb0| 6f 20 6e 61 6d 65 20 61 | 6e 64 20 74 68 65 20 6f |o name a|nd the o|
|00002cc0| 70 65 6e 20 64 65 6c 69 | 6d 69 74 65 72 20 6f 66 |pen deli|miter of|
|00002cd0| 20 74 68 65 20 70 61 72 | 61 6d 65 74 65 72 20 62 | the par|ameter b|
|00002ce0| 6c 6f 63 6b 20 69 6e 0a | 61 20 64 65 66 69 6e 69 |lock in.|a defini|
|00002cf0| 74 69 6f 6e 2c 20 61 6e | 64 20 74 68 65 20 64 65 |tion, an|d the de|
|00002d00| 6c 69 6d 69 74 65 72 73 | 20 28 69 66 20 70 72 65 |limiters| (if pre|
|00002d10| 73 65 6e 74 29 20 6d 75 | 73 74 20 62 65 20 28 29 |sent) mu|st be ()|
|00002d20| 2e 20 20 4d 61 63 72 6f | 20 6e 61 6d 65 73 0a 63 |. Macro| names.c|
|00002d30| 61 6e 20 6e 6f 74 20 63 | 6f 6e 74 61 69 6e 20 74 |an not c|ontain t|
|00002d40| 68 65 20 6f 70 65 6e 20 | 70 61 72 65 6e 73 2e 20 |he open |parens. |
|00002d50| 20 45 78 61 6d 70 6c 65 | 73 20 6f 66 20 6d 61 63 | Example|s of mac|
|00002d60| 72 6f 73 20 77 69 74 68 | 20 6d 6f 72 65 20 74 68 |ros with| more th|
|00002d70| 61 6e 0a 6f 6e 65 20 6c | 69 6e 65 20 61 72 65 3a |an.one l|ine are:|
|00002d80| 0a 0a 20 20 20 3a 20 7d | 0a 09 65 6e 64 20 64 6f |.. : }|..end do|
|00002d90| 20 3b 0a 20 20 20 3a 20 | 7b 0a 09 3b 0a 0a 54 68 | ;. : |{..;..Th|
|00002da0| 65 73 65 20 77 69 6c 6c | 20 61 6c 6c 6f 77 20 74 |ese will| allow t|
|00002db0| 72 61 6e 73 6c 61 74 69 | 6f 6e 20 6f 66 20 72 61 |ranslati|on of ra|
|00002dc0| 74 66 6f 72 20 73 74 79 | 6c 65 20 64 6f 20 6c 6f |tfor sty|le do lo|
|00002dd0| 6f 70 73 3a 0a 0a 09 64 | 6f 20 69 20 3d 20 31 2c |ops:...d|o i = 1,|
|00002de0| 20 31 30 20 7b 20 77 72 | 69 74 65 28 2a 2c 2a 29 | 10 { wr|ite(*,*)|
|00002df0| 20 27 20 69 20 3d 20 27 | 2c 20 69 20 7d 0a 0a 69 | ' i = '|, i }..i|
|00002e00| 73 20 74 72 61 6e 73 6c | 61 74 65 64 20 69 6e 74 |s transl|ated int|
|00002e10| 6f 3a 0a 0a 09 64 6f 20 | 69 20 3d 20 31 2c 20 31 |o:...do |i = 1, 1|
|00002e20| 30 0a 09 77 72 69 74 65 | 28 2a 2c 2a 29 20 27 20 |0..write|(*,*) ' |
|00002e30| 69 20 3d 20 27 2c 20 69 | 0a 09 65 6e 64 20 64 6f |i = ', i|..end do|
|00002e40| 0a 0a 77 68 69 63 68 20 | 77 69 6c 6c 20 62 65 20 |..which |will be |
|00002e50| 74 72 61 6e 73 6c 61 74 | 65 64 20 69 6e 74 6f 20 |translat|ed into |
|00002e60| 66 6f 72 74 72 61 6e 20 | 64 75 72 69 6e 67 20 74 |fortran |during t|
|00002e70| 68 65 20 66 6c 6f 77 20 | 63 6f 6e 74 72 6f 6c 20 |he flow |control |
|00002e80| 70 72 6f 63 65 73 73 69 | 6e 67 2e 0a 4e 6f 74 65 |processi|ng..Note|
|00002e90| 20 74 68 61 74 20 74 68 | 69 73 20 65 78 61 6d 70 | that th|is examp|
|00002ea0| 6c 65 20 72 65 6c 69 65 | 73 20 6f 6e 20 74 68 65 |le relie|s on the|
|00002eb0| 20 66 61 63 74 20 74 68 | 65 20 77 68 69 74 65 73 | fact th|e whites|
|00002ec0| 70 61 63 65 20 62 65 74 | 77 65 65 6e 20 74 68 65 |pace bet|ween the|
|00002ed0| 0a 6d 61 63 72 6f 20 64 | 65 66 69 6e 69 74 69 6f |.macro d|efinitio|
|00002ee0| 6e 20 61 6e 64 20 69 74 | 73 20 74 65 72 6d 69 6e |n and it|s termin|
|00002ef0| 61 74 69 6e 67 20 3b 20 | 69 73 20 73 69 67 6e 69 |ating ; |is signi|
|00002f00| 66 69 63 61 6e 74 20 28 | 6e 65 77 6c 69 6e 65 20 |ficant (|newline |
|00002f10| 69 73 20 6e 6f 74 0a 63 | 6f 6e 73 69 64 65 72 65 |is not.c|onsidere|
|00002f20| 64 20 77 68 69 74 65 73 | 70 61 63 65 20 68 65 72 |d whites|pace her|
|00002f30| 65 29 2e 20 20 54 68 69 | 73 20 69 73 20 6e 6f 74 |e). Thi|s is not|
|00002f40| 20 74 68 65 20 63 61 73 | 65 20 66 6f 72 20 77 68 | the cas|e for wh|
|00002f50| 69 74 65 73 70 61 63 65 | 20 62 65 74 77 65 65 6e |itespace| between|
|00002f60| 0a 74 68 65 20 6e 61 6d | 65 20 61 6e 64 20 74 68 |.the nam|e and th|
|00002f70| 65 20 64 65 66 69 6e 69 | 74 69 6f 6e 2e 20 20 46 |e defini|tion. F|
|00002f80| 61 69 6c 75 72 65 20 74 | 6f 20 68 61 76 65 20 61 |ailure t|o have a|
|00002f90| 20 74 65 72 6d 69 6e 61 | 74 69 6e 67 20 3b 20 77 | termina|ting ; w|
|00002fa0| 69 6c 6c 20 64 65 66 69 | 6e 65 0a 74 68 65 20 65 |ill defi|ne.the e|
|00002fb0| 6e 74 69 72 65 20 70 72 | 6f 67 72 61 6d 20 74 6f |ntire pr|ogram to|
|00002fc0| 20 62 65 20 61 20 6d 61 | 63 72 6f 2e 20 20 54 68 | be a ma|cro. Th|
|00002fd0| 69 73 20 63 6f 75 6c 64 | 20 63 61 75 73 65 20 61 |is could| cause a|
|00002fe0| 20 6d 65 6d 6f 72 79 20 | 61 6c 6c 6f 63 61 74 69 | memory |allocati|
|00002ff0| 6f 6e 0a 66 61 69 6c 75 | 72 65 2c 20 61 73 20 6d |on.failu|re, as m|
|00003000| 61 63 72 6f 73 20 61 72 | 65 20 73 74 6f 72 65 64 |acros ar|e stored|
|00003010| 20 69 6e 20 6d 65 6d 6f | 72 79 2e 0a 20 20 20 20 | in memo|ry.. |
|00003020| 20 57 68 69 6c 65 20 69 | 6e 20 61 20 64 65 66 69 | While i|n a defi|
|00003030| 6e 69 74 69 6f 6e 20 74 | 68 65 20 6f 70 65 6e 20 |nition t|he open |
|00003040| 70 61 72 65 6e 73 20 6d | 75 73 74 20 66 6f 6c 6c |parens m|ust foll|
|00003050| 6f 77 20 74 68 65 20 6e | 61 6d 65 20 77 69 74 68 |ow the n|ame with|
|00003060| 6f 75 74 0a 77 68 69 74 | 65 73 70 61 63 65 2c 20 |out.whit|espace, |
|00003070| 69 6e 20 74 68 65 20 73 | 6f 75 72 63 65 20 63 6f |in the s|ource co|
|00003080| 64 65 20 74 68 69 73 20 | 72 65 71 75 69 72 65 6d |de this |requirem|
|00003090| 65 6e 74 20 28 61 6e 64 | 20 74 68 65 20 6e 65 65 |ent (and| the nee|
|000030a0| 64 20 74 6f 20 75 73 65 | 20 6f 6e 6c 79 0a 28 29 |d to use| only.()|
|000030b0| 20 61 73 20 64 65 6c 69 | 6d 69 74 65 72 73 29 20 | as deli|miters) |
|000030c0| 69 73 20 72 65 6c 61 78 | 65 64 2e 20 20 41 6c 70 |is relax|ed. Alp|
|000030d0| 68 61 6e 75 6d 65 72 69 | 63 20 6d 61 63 72 6f 73 |hanumeri|c macros|
|000030e0| 20 6d 75 73 74 20 62 65 | 20 6e 6f 74 20 62 65 20 | must be| not be |
|000030f0| 6e 65 78 74 20 74 6f 0a | 61 6e 20 61 6c 70 68 61 |next to.|an alpha|
|00003100| 20 6f 72 20 6e 75 6d 62 | 65 72 20 63 68 61 72 61 | or numb|er chara|
|00003110| 63 74 65 72 20 6f 72 20 | 74 68 65 79 20 77 69 6c |cter or |they wil|
|00003120| 6c 20 6e 6f 74 20 62 65 | 20 72 65 63 6f 67 6e 69 |l not be| recogni|
|00003130| 7a 65 64 2e 0a 20 20 20 | 20 20 54 68 65 20 6d 61 |zed.. | The ma|
|00003140| 63 72 6f 20 64 65 66 69 | 6e 69 74 69 6f 6e 20 72 |cro defi|nition r|
|00003150| 6f 75 74 69 6e 65 20 70 | 75 74 73 20 74 68 65 20 |outine p|uts the |
|00003160| 6d 61 63 72 6f 20 73 74 | 72 69 6e 67 20 69 6e 74 |macro st|ring int|
|00003170| 6f 20 61 20 6d 6f 72 65 | 20 65 61 73 69 6c 79 0a |o a more| easily.|
|00003180| 68 61 6e 64 6c 65 64 20 | 66 6f 72 6d 61 74 2c 20 |handled |format, |
|00003190| 72 65 70 6c 61 63 69 6e | 67 20 70 61 72 61 6d 65 |replacin|g parame|
|000031a0| 74 65 72 73 20 69 6e 20 | 74 68 65 20 74 65 78 74 |ters in |the text|
|000031b0| 20 77 69 74 68 20 6e 2c | 20 77 68 65 72 65 20 6e | with n,| where n|
|000031c0| 20 69 73 20 61 0a 62 69 | 6e 61 72 79 20 76 61 6c | is a.bi|nary val|
|000031d0| 75 65 20 28 31 32 38 20 | 74 6f 20 31 32 38 2b 4d |ue (128 |to 128+M|
|000031e0| 41 58 5f 54 4f 4b 45 4e | 53 29 2e 20 20 54 68 65 |AX_TOKEN|S). The|
|000031f0| 20 6d 61 63 72 6f 20 69 | 73 20 70 6c 61 63 65 64 | macro i|s placed|
|00003200| 20 69 6e 20 61 20 73 74 | 72 75 63 74 75 72 65 0a | in a st|ructure.|
|00003210| 6f 66 20 74 68 65 20 66 | 6f 72 6d 3a 0a 0a 73 74 |of the f|orm:..st|
|00003220| 72 75 63 74 20 6d 61 63 | 20 7b 0a 09 63 68 61 72 |ruct mac| {..char|
|00003230| 20 2a 6e 61 6d 65 20 3b | 09 09 6d 61 63 72 6f 20 | *name ;|..macro |
|00003240| 69 64 20 74 61 67 0a 09 | 63 68 61 72 20 2a 74 65 |id tag..|char *te|
|00003250| 78 74 20 3b 09 09 65 6e | 63 6f 64 65 64 20 6d 61 |xt ;..en|coded ma|
|00003260| 63 72 6f 20 74 65 78 74 | 0a 09 69 6e 74 20 20 70 |cro text|..int p|
|00003270| 61 72 6d 63 6f 75 6e 74 | 20 3b 09 6e 75 6d 62 65 |armcount| ;.numbe|
|00003280| 72 20 6f 66 20 61 72 67 | 75 6d 65 6e 74 73 0a 09 |r of arg|uments..|
|00003290| 69 6e 74 20 20 63 61 6c | 6c 63 6f 75 6e 74 20 3b |int cal|lcount ;|
|000032a0| 09 72 65 63 75 72 73 69 | 6f 6e 20 63 68 65 63 6b |.recursi|on check|
|000032b0| 0a 7d 20 6d 61 63 72 6f | 5b 4d 41 58 5f 4d 41 43 |.} macro|[MAX_MAC|
|000032c0| 52 4f 53 5d 20 3b 0a 0a | 77 68 65 72 65 20 74 68 |ROS] ;..|where th|
|000032d0| 65 20 74 65 78 74 20 73 | 74 72 69 6e 67 20 68 61 |e text s|tring ha|
|000032e0| 73 20 62 69 6e 61 72 79 | 20 73 79 6d 62 6f 6c 73 |s binary| symbols|
|000032f0| 20 77 68 65 72 65 20 74 | 68 65 20 70 61 72 6d 73 | where t|he parms|
|00003300| 20 77 65 72 65 2e 20 20 | 50 61 72 6d 63 6f 75 6e | were. |Parmcoun|
|00003310| 74 0a 69 73 20 75 73 65 | 64 20 74 6f 20 73 65 65 |t.is use|d to see|
|00003320| 20 69 66 20 61 20 70 61 | 72 61 6d 65 74 65 72 20 | if a pa|rameter |
|00003330| 62 6c 6f 63 6b 20 73 68 | 6f 75 6c 64 20 62 65 20 |block sh|ould be |
|00003340| 73 65 61 72 63 68 65 64 | 20 66 6f 72 20 77 68 65 |searched| for whe|
|00003350| 6e 20 65 78 70 61 6e 64 | 69 6e 67 0a 61 20 6d 61 |n expand|ing.a ma|
|00003360| 63 72 6f 2e 20 20 43 61 | 6c 6c 63 6f 75 6e 74 20 |cro. Ca|llcount |
|00003370| 69 73 20 75 73 65 64 20 | 74 6f 20 73 74 6f 70 20 |is used |to stop |
|00003380| 65 78 70 61 6e 73 69 6f | 6e 20 69 6e 20 63 61 73 |expansio|n in cas|
|00003390| 65 20 6f 66 20 72 65 63 | 75 72 73 69 76 65 20 64 |e of rec|ursive d|
|000033a0| 65 66 69 6e 69 74 69 6f | 6e 73 2e 0a 20 20 20 20 |efinitio|ns.. |
|000033b0| 20 43 61 75 74 69 6f 6e | 20 6d 75 73 74 20 62 65 | Caution| must be|
|000033c0| 20 65 78 65 72 63 69 73 | 65 64 20 74 6f 20 61 76 | exercis|ed to av|
|000033d0| 6f 69 64 20 61 63 63 69 | 64 65 6e 74 61 6c 20 72 |oid acci|dental r|
|000033e0| 65 63 75 72 73 69 76 65 | 20 64 65 66 69 6e 69 74 |ecursive| definit|
|000033f0| 69 6f 6e 73 0a 69 6e 76 | 6f 6c 76 69 6e 67 20 6d |ions.inv|olving m|
|00003400| 6f 72 65 20 74 68 61 6e | 20 6f 6e 65 20 6d 61 63 |ore than| one mac|
|00003410| 72 6f 3a 0a 0a 09 3a 20 | 68 09 69 2b 78 20 3b 0a |ro:...: |h.i+x ;.|
|00003420| 09 3a 20 69 28 79 29 09 | 66 75 6e 63 28 79 29 20 |.: i(y).|func(y) |
|00003430| 3b 0a 09 3a 20 66 75 6e | 63 09 68 20 3b 0a 0a 54 |;..: fun|c.h ;..T|
|00003440| 68 69 73 20 77 69 6c 6c | 20 67 65 6e 65 72 61 74 |his will| generat|
|00003450| 65 20 74 68 65 20 73 75 | 63 63 65 73 73 69 76 65 |e the su|ccessive|
|00003460| 20 73 74 72 69 6e 67 73 | 20 28 66 72 6f 6d 20 61 | strings| (from a|
|00003470| 20 3d 20 66 75 6e 63 28 | 78 29 29 3a 0a 0a 09 61 | = func(|x)):...a|
|00003480| 20 3d 20 68 28 78 29 0a | 09 61 20 3d 20 69 2b 78 | = h(x).|.a = i+x|
|00003490| 28 78 29 0a 09 61 20 3d | 20 66 75 6e 63 28 29 2b |(x)..a =| func()+|
|000034a0| 78 28 78 29 0a 09 61 20 | 3d 20 68 28 29 2b 78 28 |x(x)..a |= h()+x(|
|000034b0| 78 29 20 2e 2e 2e 2e 20 | 61 6e 64 20 73 6f 20 6f |x) .... |and so o|
|000034c0| 6e 2e 20 20 42 65 77 61 | 72 65 2e 0a 0a 20 20 20 |n. Bewa|re... |
|000034d0| 20 20 4d 61 63 72 6f 20 | 6e 61 6d 65 73 20 77 69 | Macro |names wi|
|000034e0| 6c 6c 20 6e 6f 74 20 62 | 65 20 66 6c 61 67 67 65 |ll not b|e flagge|
|000034f0| 64 20 69 66 20 74 68 65 | 79 20 61 72 65 20 71 75 |d if the|y are qu|
|00003500| 6f 74 65 64 20 28 77 69 | 74 68 20 61 70 6f 73 74 |oted (wi|th apost|
|00003510| 72 6f 70 68 65 73 29 0a | 69 6e 20 74 68 65 20 73 |rophes).|in the s|
|00003520| 6f 75 72 63 65 2c 20 6f | 72 20 69 66 20 74 68 65 |ource, o|r if the|
|00003530| 79 20 61 72 65 20 69 6e | 20 63 6f 6d 6d 65 6e 74 |y are in| comment|
|00003540| 20 72 65 63 6f 72 64 73 | 2e 0a 20 20 20 20 20 49 | records|.. I|
|00003550| 66 20 6d 6f 72 65 20 70 | 61 72 61 6d 65 74 65 72 |f more p|arameter|
|00003560| 73 20 61 72 65 20 66 6f | 75 6e 64 20 74 68 61 6e |s are fo|und than|
|00003570| 20 77 65 72 65 20 70 72 | 65 73 65 6e 74 20 69 6e | were pr|esent in|
|00003580| 20 74 68 65 20 64 65 66 | 69 6e 69 74 69 6f 6e 2c | the def|inition,|
|00003590| 20 74 68 65 0a 74 72 61 | 69 6c 65 72 73 20 61 72 | the.tra|ilers ar|
|000035a0| 65 20 69 67 6e 6f 72 65 | 64 2e 20 20 49 66 20 66 |e ignore|d. If f|
|000035b0| 65 77 65 72 20 61 72 65 | 20 66 6f 75 6e 64 20 74 |ewer are| found t|
|000035c0| 68 65 79 20 77 69 6c 6c | 20 62 65 20 69 6e 73 65 |hey will| be inse|
|000035d0| 72 74 65 64 20 77 68 65 | 72 65 0a 65 78 70 65 63 |rted whe|re.expec|
|000035e0| 74 65 64 20 6f 6e 6c 79 | 20 28 74 68 65 20 6d 69 |ted only| (the mi|
|000035f0| 73 73 69 6e 67 20 70 61 | 72 61 6d 65 74 65 72 73 |ssing pa|rameters|
|00003600| 20 77 69 6c 6c 20 62 65 | 20 74 61 6b 65 6e 20 74 | will be| taken t|
|00003610| 6f 20 62 65 20 6e 75 6c | 6c 20 73 74 72 69 6e 67 |o be nul|l string|
|00003620| 73 29 2e 0a 50 61 72 61 | 6d 65 74 65 72 73 20 61 |s)..Para|meters a|
|00003630| 72 65 20 73 65 70 61 72 | 61 74 65 64 20 62 79 20 |re separ|ated by |
|00003640| 63 6f 6d 6d 61 73 2c 20 | 61 6e 64 20 61 72 65 20 |commas, |and are |
|00003650| 6f 6e 6c 79 20 72 65 63 | 6f 67 6e 69 7a 65 64 20 |only rec|ognized |
|00003660| 69 66 20 74 68 65 79 20 | 61 72 65 0a 62 61 6c 61 |if they |are.bala|
|00003670| 6e 63 65 64 20 61 63 63 | 6f 72 64 69 6e 67 20 74 |nced acc|ording t|
|00003680| 6f 20 64 65 6c 69 6d 69 | 74 65 72 73 2e 20 20 49 |o delimi|ters. I|
|00003690| 66 20 3a 20 4d 41 43 52 | 4f 28 61 2c 62 29 20 61 |f : MACR|O(a,b) a|
|000036a0| 20 2b 20 62 20 3b 20 69 | 73 20 64 65 66 69 6e 65 | + b ; i|s define|
|000036b0| 64 0a 61 6e 64 0a 0a 09 | 4d 41 43 52 4f 20 22 20 |d.and...|MACRO " |
|000036c0| 5b 69 2c 6a 5d 20 22 0a | 0a 69 73 20 66 6f 75 6e |[i,j] ".|.is foun|
|000036d0| 64 20 69 6e 20 74 68 65 | 20 74 65 78 74 2c 20 6f |d in the| text, o|
|000036e0| 6e 6c 79 20 6f 6e 65 20 | 70 61 72 61 6d 65 74 65 |nly one |paramete|
|000036f0| 72 20 77 69 6c 6c 20 62 | 65 20 66 6f 75 6e 64 20 |r will b|e found |
|00003700| 61 6e 64 20 69 74 20 77 | 69 6c 6c 20 62 65 0a 65 |and it w|ill be.e|
|00003710| 78 70 61 6e 64 65 64 20 | 61 73 3a 0a 0a 09 5b 69 |xpanded |as:...[i|
|00003720| 2c 6a 5d 20 2b 0a 0a 49 | 74 20 69 73 20 6e 6f 74 |,j] +..I|t is not|
|00003730| 20 70 6f 73 73 69 62 6c | 65 20 74 6f 20 68 61 76 | possibl|e to hav|
|00003740| 65 20 75 6e 62 61 6c 61 | 6e 63 65 64 20 64 65 6c |e unbala|nced del|
|00003750| 69 6d 69 74 65 72 73 20 | 69 6e 20 61 20 70 61 72 |imiters |in a par|
|00003760| 61 6d 65 74 65 72 20 6f | 66 20 61 20 0a 6d 61 63 |ameter o|f a .mac|
|00003770| 72 6f 20 75 6e 6c 65 73 | 73 20 74 68 65 20 6d 61 |ro unles|s the ma|
|00003780| 63 72 6f 20 6f 6e 6c 79 | 20 68 61 73 20 6f 6e 65 |cro only| has one|
|00003790| 20 61 72 67 75 6d 65 6e | 74 2e 0a 0a 0a 0a 46 6c | argumen|t.....Fl|
|000037a0| 6f 77 20 43 6f 6e 74 72 | 6f 6c 20 45 78 74 65 6e |ow Contr|ol Exten|
|000037b0| 73 69 6f 6e 73 0a 20 20 | 20 20 20 54 68 65 73 65 |sions. | These|
|000037c0| 20 63 6f 6d 6d 61 6e 64 | 73 20 61 72 65 20 62 61 | command|s are ba|
|000037d0| 73 65 64 20 6f 6e 20 74 | 68 65 20 66 6c 6f 77 20 |sed on t|he flow |
|000037e0| 63 6f 6e 74 72 6f 6c 20 | 6f 66 20 66 6f 72 74 68 |control |of forth|
|000037f0| 20 28 65 78 63 65 70 74 | 20 66 6f 72 0a 74 68 65 | (except| for.the|
|00003800| 20 64 6f 2f 65 6e 64 5f | 64 6f 20 63 6f 6e 73 74 | do/end_|do const|
|00003810| 72 75 63 74 29 2e 20 20 | 57 69 74 68 20 74 68 65 |ruct). |With the|
|00003820| 20 65 78 63 65 70 74 69 | 6f 6e 20 6f 66 20 74 68 | excepti|on of th|
|00003830| 65 20 4f 46 20 61 6e 64 | 20 44 45 46 41 55 4c 54 |e OF and| DEFAULT|
|00003840| 0a 63 6f 6d 6d 61 6e 64 | 73 2c 20 6e 6f 20 6f 74 |.command|s, no ot|
|00003850| 68 65 72 20 74 65 78 74 | 20 69 73 20 61 6c 6c 6f |her text| is allo|
|00003860| 77 65 64 20 6f 6e 20 74 | 68 65 20 6c 69 6e 65 2e |wed on t|he line.|
|00003870| 20 20 49 66 20 74 72 61 | 69 6c 69 6e 67 20 74 65 | If tra|iling te|
|00003880| 78 74 20 69 73 0a 70 72 | 65 73 65 6e 74 20 69 74 |xt is.pr|esent it|
|00003890| 20 69 73 20 69 67 6e 6f | 72 65 64 2c 20 6c 65 61 | is igno|red, lea|
|000038a0| 64 69 6e 67 20 74 65 78 | 74 20 77 69 6c 6c 20 70 |ding tex|t will p|
|000038b0| 72 65 76 65 6e 74 20 50 | 52 45 50 20 66 72 6f 6d |revent P|REP from|
|000038c0| 20 73 65 65 69 6e 67 20 | 74 68 65 0a 63 6f 6d 6d | seeing |the.comm|
|000038d0| 61 6e 64 2e 20 20 54 68 | 69 73 20 69 6e 63 6c 75 |and. Th|is inclu|
|000038e0| 64 65 73 20 6c 61 62 65 | 6c 73 3a 20 50 52 45 50 |des labe|ls: PREP|
|000038f0| 20 63 6f 6d 6d 61 6e 64 | 20 6c 69 6e 65 73 20 6d | command| lines m|
|00003900| 61 79 20 6e 6f 74 20 68 | 61 76 65 20 6c 61 62 65 |ay not h|ave labe|
|00003910| 6c 73 0a 75 6e 6c 65 73 | 73 20 6d 61 63 72 6f 73 |ls.unles|s macros|
|00003920| 20 61 72 65 20 75 73 65 | 64 20 74 6f 20 64 65 66 | are use|d to def|
|00003930| 69 6e 65 20 6c 61 62 65 | 6c 73 20 74 6f 20 65 78 |ine labe|ls to ex|
|00003940| 70 61 6e 64 20 61 73 20 | 63 6f 6e 74 69 6e 75 65 |pand as |continue|
|00003950| 20 73 74 61 74 65 6d 65 | 6e 74 73 0a 61 6e 64 20 | stateme|nts.and |
|00003960| 6e 65 77 6c 69 6e 65 73 | 2e 20 20 54 68 65 20 63 |newlines|. The c|
|00003970| 6f 6d 6d 61 6e 64 73 20 | 65 6e 64 5f 63 61 73 65 |ommands |end_case|
|00003980| 2c 20 65 6e 64 5f 64 6f | 2c 20 61 6e 64 20 6c 65 |, end_do|, and le|
|00003990| 61 76 65 5f 64 6f 20 63 | 61 6e 20 68 61 76 65 20 |ave_do c|an have |
|000039a0| 61 0a 73 70 61 63 65 20 | 69 6e 73 74 65 61 64 20 |a.space |instead |
|000039b0| 6f 66 20 74 68 65 20 75 | 6e 64 65 72 6c 69 6e 65 |of the u|nderline|
|000039c0| 2c 20 62 75 74 20 74 68 | 65 20 73 70 61 63 65 20 |, but th|e space |
|000039d0| 69 73 20 73 69 67 6e 69 | 66 69 63 61 6e 74 2e 20 |is signi|ficant. |
|000039e0| 20 4f 66 20 63 6f 75 72 | 73 65 0a 61 20 6d 61 63 | Of cour|se.a mac|
|000039f0| 72 6f 20 63 6f 75 6c 64 | 20 62 65 20 64 65 66 69 |ro could| be defi|
|00003a00| 6e 65 64 20 61 73 20 20 | 20 20 3a 20 65 6e 64 64 |ned as | : endd|
|00003a10| 6f 20 65 6e 64 5f 64 6f | 20 3b 2e 20 20 55 6e 6c |o end_do| ;. Unl|
|00003a20| 69 6b 65 20 73 6f 6d 65 | 20 6f 74 68 65 72 0a 6c |ike some| other.l|
|00003a30| 61 6e 67 75 61 67 65 73 | 20 28 66 6f 72 74 68 20 |anguages| (forth |
|00003a40| 61 6e 64 20 63 29 20 77 | 68 65 72 65 20 43 4f 4e |and c) w|here CON|
|00003a50| 54 49 4e 55 45 20 61 70 | 70 6c 69 65 73 20 74 6f |TINUE ap|plies to|
|00003a60| 20 61 6c 6c 20 74 79 70 | 65 73 20 6f 66 20 6c 6f | all typ|es of lo|
|00003a70| 6f 70 73 2c 0a 68 65 72 | 65 20 74 68 65 72 65 20 |ops,.her|e there |
|00003a80| 61 72 65 20 74 68 72 65 | 65 20 43 4f 4e 54 49 4e |are thre|e CONTIN|
|00003a90| 55 45 20 73 74 61 74 65 | 6d 65 6e 74 73 20 28 63 |UE state|ments (c|
|00003aa0| 6f 6e 74 69 6e 75 65 2c | 20 63 6f 6e 74 69 6e 75 |ontinue,| continu|
|00003ab0| 65 5f 64 6f 2c 20 61 6e | 64 0a 63 6f 6e 74 69 6e |e_do, an|d.contin|
|00003ac0| 75 65 5f 63 61 73 65 29 | 20 77 68 69 63 68 20 61 |ue_case)| which a|
|00003ad0| 70 70 6c 79 20 74 6f 20 | 74 68 65 20 74 68 72 65 |pply to |the thre|
|00003ae0| 65 20 63 6c 61 73 73 65 | 73 20 6f 66 20 6c 6f 6f |e classe|s of loo|
|00003af0| 70 73 20 73 75 70 70 6f | 72 74 65 64 20 62 79 0a |ps suppo|rted by.|
|00003b00| 50 52 45 50 2e 20 20 54 | 68 69 73 20 61 76 6f 69 |PREP. T|his avoi|
|00003b10| 64 73 20 73 6f 6d 65 20 | 63 6f 6e 66 75 73 69 6f |ds some |confusio|
|00003b20| 6e 20 69 6e 20 63 65 72 | 74 61 69 6e 20 73 69 74 |n in cer|tain sit|
|00003b30| 75 61 74 69 6f 6e 73 20 | 77 69 74 68 20 6e 65 73 |uations |with nes|
|00003b40| 74 65 64 0a 6c 6f 6f 70 | 73 20 6f 66 20 64 69 66 |ted.loop|s of dif|
|00003b50| 66 65 72 69 6e 67 20 74 | 79 70 65 73 2e 20 20 49 |fering t|ypes. I|
|00003b60| 6e 20 67 65 6e 65 72 61 | 6c 20 66 6f 72 20 74 68 |n genera|l for th|
|00003b70| 65 20 66 6c 6f 77 20 63 | 6f 6e 74 72 6f 6c 20 65 |e flow c|ontrol e|
|00003b80| 78 74 65 6e 73 69 6f 6e | 73 2c 0a 69 66 20 6f 70 |xtension|s,.if op|
|00003b90| 74 69 6f 6e 61 6c 20 65 | 78 70 72 65 73 73 69 6f |tional e|xpressio|
|00003ba0| 6e 73 20 61 72 65 20 6f | 6d 69 74 74 65 64 20 74 |ns are o|mitted t|
|00003bb0| 68 65 79 20 61 72 65 20 | 74 61 6b 65 6e 20 74 6f |hey are |taken to|
|00003bc0| 20 62 65 20 54 52 55 45 | 2e 0a 0a 0a 20 46 6f 72 | be TRUE|.... For|
|00003bd0| 74 68 20 73 74 79 6c 65 | 20 62 65 67 69 6e 2f 77 |th style| begin/w|
|00003be0| 68 69 6c 65 2f 75 6e 74 | 69 6c 2f 61 67 61 69 6e |hile/unt|il/again|
|00003bf0| 20 63 6f 6e 73 74 72 75 | 63 74 3a 0a 20 20 20 20 | constru|ct:. |
|00003c00| 20 62 65 67 69 6e 20 2e | 2e 2e 20 61 67 61 69 6e | begin .|.. again|
|00003c10| 0a 20 20 20 20 20 62 65 | 67 69 6e 20 2e 2e 2e 20 |. be|gin ... |
|00003c20| 77 68 69 6c 65 20 28 65 | 78 70 31 29 20 2e 2e 2e |while (e|xp1) ...|
|00003c30| 20 61 67 61 69 6e 0a 20 | 20 20 20 20 62 65 67 69 | again. | begi|
|00003c40| 6e 20 2e 2e 2e 20 75 6e | 74 69 6c 20 28 65 78 70 |n ... un|til (exp|
|00003c50| 31 29 0a 20 20 20 20 20 | 6c 65 61 76 65 20 28 6f |1). |leave (o|
|00003c60| 70 74 69 6f 6e 61 6c 20 | 65 78 70 72 65 73 73 69 |ptional |expressi|
|00003c70| 6f 6e 29 20 74 6f 20 65 | 78 69 74 20 63 75 72 72 |on) to e|xit curr|
|00003c80| 65 6e 74 20 6c 65 76 65 | 6c 0a 20 20 20 20 20 63 |ent leve|l. c|
|00003c90| 6f 6e 74 69 6e 75 65 20 | 28 6f 70 74 69 6f 6e 61 |ontinue |(optiona|
|00003ca0| 6c 20 65 78 70 72 65 73 | 73 69 6f 6e 29 20 74 6f |l expres|sion) to|
|00003cb0| 20 67 6f 74 20 62 61 63 | 6b 20 74 6f 20 62 65 67 | got bac|k to beg|
|00003cc0| 69 6e 0a 0a 20 20 20 20 | 20 48 65 72 65 20 74 68 |in.. | Here th|
|00003cd0| 65 20 2e 2e 2e 27 73 20 | 72 65 70 72 65 73 65 6e |e ...'s |represen|
|00003ce0| 74 20 6c 69 6e 65 73 20 | 6f 66 20 50 52 45 50 20 |t lines |of PREP |
|00003cf0| 61 6e 64 20 66 6f 72 74 | 72 61 6e 20 63 6f 64 65 |and fort|ran code|
|00003d00| 2c 20 6e 6f 74 20 6f 6e | 0a 74 68 65 20 73 61 6d |, not on|.the sam|
|00003d10| 65 20 6c 69 6e 65 20 77 | 69 74 68 20 74 68 65 20 |e line w|ith the |
|00003d20| 64 69 72 65 63 74 69 76 | 65 73 2e 20 20 41 20 77 |directiv|es. A w|
|00003d30| 6f 72 6b 69 6e 67 20 65 | 78 61 6d 70 6c 65 20 6f |orking e|xample o|
|00003d40| 66 20 6f 6e 65 20 6f 66 | 20 74 68 65 73 65 0a 69 |f one of| these.i|
|00003d50| 73 3a 0a 20 20 20 20 20 | 62 65 67 69 6e 0a 20 20 |s:. |begin. |
|00003d60| 20 20 20 20 20 20 6c 69 | 6e 65 20 6f 66 20 63 6f | li|ne of co|
|00003d70| 64 65 0a 20 20 20 20 20 | 77 68 69 6c 65 20 28 20 |de. |while ( |
|00003d80| 53 4f 4d 45 5f 4d 41 43 | 52 4f 5b 69 5d 20 29 20 |SOME_MAC|RO[i] ) |
|00003d90| 20 20 3b 20 74 68 65 20 | 6d 61 63 72 6f 20 65 76 | ; the |macro ev|
|00003da0| 61 6c 75 61 74 65 73 20 | 74 6f 20 61 20 6c 6f 67 |aluates |to a log|
|00003db0| 69 63 61 6c 20 65 78 70 | 72 65 73 73 69 6f 6e 0a |ical exp|ression.|
|00003dc0| 20 20 20 20 20 20 20 20 | 6c 69 6e 65 20 6f 66 20 | |line of |
|00003dd0| 63 6f 64 65 0a 20 20 20 | 20 20 20 20 20 6c 69 6e |code. | lin|
|00003de0| 65 20 6f 66 20 63 6f 64 | 65 0a 20 20 20 20 20 61 |e of cod|e. a|
|00003df0| 67 61 69 6e 0a 0a 54 68 | 65 20 62 65 67 69 6e 20 |gain..Th|e begin |
|00003e00| 2e 2e 2e 20 61 67 61 69 | 6e 20 63 6f 6e 73 74 72 |... agai|n constr|
|00003e10| 75 63 74 20 77 69 6c 6c | 20 6c 6f 6f 70 20 66 6f |uct will| loop fo|
|00003e20| 72 65 76 65 72 2e 20 20 | 55 73 75 61 6c 6c 79 20 |rever. |Usually |
|00003e30| 69 74 20 77 69 6c 6c 20 | 68 61 76 65 20 61 0a 6c |it will |have a.l|
|00003e40| 65 61 76 65 20 63 6f 6d | 6d 61 6e 64 20 69 6e 73 |eave com|mand ins|
|00003e50| 69 64 65 20 28 20 6c 65 | 61 76 65 20 5b 20 45 4f |ide ( le|ave [ EO|
|00003e60| 46 20 5d 2c 20 77 68 65 | 72 65 20 45 4f 46 20 69 |F ], whe|re EOF i|
|00003e70| 73 20 61 20 6d 61 63 72 | 6f 20 29 2c 20 6f 72 20 |s a macr|o ), or |
|00003e80| 61 0a 72 65 74 75 72 6e | 20 74 6f 20 63 61 6c 6c |a.return| to call|
|00003e90| 65 72 2e 20 20 54 68 65 | 73 65 20 28 61 73 20 77 |er. The|se (as w|
|00003ea0| 69 74 68 20 74 68 65 20 | 63 61 73 65 20 63 6f 6e |ith the |case con|
|00003eb0| 73 74 72 75 63 74 20 61 | 6e 64 20 64 6f 2f 65 6e |struct a|nd do/en|
|00003ec0| 64 5f 64 6f 29 20 6d 61 | 79 0a 62 65 20 6e 65 73 |d_do) ma|y.be nes|
|00003ed0| 74 65 64 20 74 65 6e 20 | 6c 65 76 65 6c 73 20 64 |ted ten |levels d|
|00003ee0| 65 65 70 2e 20 20 54 68 | 65 20 62 65 67 69 6e 20 |eep. Th|e begin |
|00003ef0| 69 73 20 61 6c 77 61 79 | 73 20 6e 65 63 65 73 73 |is alway|s necess|
|00003f00| 61 72 79 2c 20 65 76 65 | 6e 20 69 74 20 74 68 65 |ary, eve|n it the|
|00003f10| 0a 6e 65 78 74 20 73 74 | 61 74 65 6d 65 6e 74 20 |.next st|atement |
|00003f20| 69 73 20 77 68 69 6c 65 | 2e 0a 0a 0a 20 43 61 73 |is while|.... Cas|
|00003f30| 65 20 63 6f 6e 73 74 72 | 75 63 74 3a 0a 20 20 20 |e constr|uct:. |
|00003f40| 20 20 63 61 73 65 20 28 | 20 6f 70 74 69 6f 6e 61 | case (| optiona|
|00003f50| 6c 20 65 78 70 20 29 0a | 20 20 20 20 20 6f 66 20 |l exp ).| of |
|00003f60| 20 20 28 20 65 78 70 32 | 20 29 20 20 6c 69 6e 65 | ( exp2| ) line|
|00003f70| 20 6f 66 20 63 6f 64 65 | 0a 20 20 20 20 20 20 20 | of code|. |
|00003f80| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 6c 69 6e | | lin|
|00003f90| 65 20 6f 66 20 63 6f 64 | 65 0a 20 20 20 20 20 20 |e of cod|e. |
|00003fa0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 63 6f | | co|
|00003fb0| 6e 74 69 6e 75 65 5f 63 | 61 73 65 20 28 20 6f 70 |ntinue_c|ase ( op|
|00003fc0| 74 69 6f 6e 61 6c 20 6c | 6f 67 69 63 61 6c 20 65 |tional l|ogical e|
|00003fd0| 78 70 20 29 0a 20 20 20 | 20 20 6f 66 20 20 20 28 |xp ). | of (|
|00003fe0| 20 65 78 70 33 20 29 20 | 20 6c 69 6e 65 20 6f 66 | exp3 ) | line of|
|00003ff0| 20 63 6f 64 65 0a 20 20 | 20 20 20 64 65 66 61 75 | code. | defau|
|00004000| 6c 74 20 20 20 20 20 20 | 20 20 6c 69 6e 65 20 6f |lt | line o|
|00004010| 66 20 63 6f 64 65 0a 20 | 20 20 20 20 20 20 20 20 |f code. | |
|00004020| 20 20 20 20 20 20 20 20 | 20 20 20 6c 69 6e 65 20 | | line |
|00004030| 6f 66 20 63 6f 64 65 0a | 20 20 20 20 20 65 6e 64 |of code.| end|
|00004040| 5f 63 61 73 65 0a 0a 20 | 20 20 20 20 54 68 69 73 |_case.. | This|
|00004050| 20 69 73 20 70 72 6f 63 | 65 73 73 65 64 20 62 79 | is proc|essed by|
|00004060| 20 63 6f 6e 76 65 72 74 | 69 6e 67 20 74 6f 20 69 | convert|ing to i|
|00004070| 66 20 65 6c 73 65 20 65 | 6e 64 69 66 20 65 78 70 |f else e|ndif exp|
|00004080| 72 65 73 73 69 6f 6e 73 | 2e 20 20 49 74 20 69 73 |ressions|. It is|
|00004090| 0a 73 6f 6d 65 77 68 61 | 74 20 63 6c 65 61 72 65 |.somewha|t cleare|
|000040a0| 72 20 69 6e 20 67 65 6e | 65 72 61 6c 2e 20 20 54 |r in gen|eral. T|
|000040b0| 68 65 20 65 78 70 72 65 | 73 73 69 6f 6e 73 20 68 |he expre|ssions h|
|000040c0| 65 72 65 20 6d 75 73 74 | 20 4e 4f 54 20 62 65 20 |ere must| NOT be |
|000040d0| 6c 6f 67 69 63 61 6c 0a | 28 2e 65 71 2e 20 69 73 |logical.|(.eq. is|
|000040e0| 20 75 73 65 64 29 2c 20 | 75 6e 6c 65 73 73 20 43 | used), |unless C|
|000040f0| 41 53 45 20 69 73 20 66 | 6f 6c 6c 6f 77 65 64 20 |ASE is f|ollowed |
|00004100| 62 79 20 6e 6f 20 70 61 | 72 61 6d 65 74 65 72 20 |by no pa|rameter |
|00004110| 69 6e 20 77 68 69 63 68 | 20 63 61 73 65 20 0a 74 |in which| case .t|
|00004120| 68 65 20 4f 46 20 65 78 | 70 72 65 73 73 69 6f 6e |he OF ex|pression|
|00004130| 73 20 4d 55 53 54 20 62 | 65 20 6c 6f 67 69 63 61 |s MUST b|e logica|
|00004140| 6c 20 65 78 70 72 65 73 | 73 69 6f 6e 73 2e 20 20 |l expres|sions. |
|00004150| 55 6e 66 6f 72 74 75 6e | 61 74 65 6c 79 20 66 6f |Unfortun|ately fo|
|00004160| 72 74 72 61 6e 0a 64 6f | 65 73 20 6e 6f 74 20 61 |rtran.do|es not a|
|00004170| 6c 6c 6f 77 20 63 6f 6d | 70 61 72 69 73 6f 6e 73 |llow com|parisons|
|00004180| 20 62 65 74 77 65 65 6e | 20 6c 6f 67 69 63 61 6c | between| logical|
|00004190| 20 65 78 70 72 65 73 73 | 69 6f 6e 73 20 75 73 69 | express|ions usi|
|000041a0| 6e 67 20 2e 65 71 2e 2c | 20 73 6f 0a 74 68 65 72 |ng .eq.,| so.ther|
|000041b0| 65 20 69 73 20 6e 6f 20 | 77 61 79 20 61 72 6f 75 |e is no |way arou|
|000041c0| 6e 64 20 74 68 69 73 20 | 64 69 6c 65 6d 6d 61 20 |nd this |dilemma |
|000041d0| 77 69 74 68 6f 75 74 20 | 68 61 76 69 6e 67 20 74 |without |having t|
|000041e0| 68 65 20 70 72 65 70 72 | 6f 63 65 73 73 6f 72 0a |he prepr|ocessor.|
|000041f0| 75 6e 64 65 72 73 74 61 | 6e 64 20 66 6f 72 74 72 |understa|nd fortr|
|00004200| 61 6e 20 74 6f 20 64 65 | 74 65 72 6d 69 6e 65 20 |an to de|termine |
|00004210| 76 61 72 69 61 62 6c 65 | 20 74 79 70 65 73 20 28 |variable| types (|
|00004220| 77 68 69 63 68 20 69 6e | 20 74 75 72 6e 20 77 6f |which in| turn wo|
|00004230| 75 6c 64 0a 72 65 71 75 | 69 72 65 20 74 68 61 74 |uld.requ|ire that|
|00004240| 20 61 6c 6c 20 66 6f 72 | 74 72 61 6e 20 69 6e 63 | all for|tran inc|
|00004250| 6c 75 64 65 20 64 69 72 | 65 63 74 69 76 65 73 20 |lude dir|ectives |
|00004260| 62 65 20 70 72 6f 63 65 | 73 73 65 64 29 2e 20 20 |be proce|ssed). |
|00004270| 4f 66 20 63 6f 75 72 73 | 65 0a 69 66 20 74 68 65 |Of cours|e.if the|
|00004280| 20 76 61 6c 75 65 20 69 | 73 20 6c 6f 67 69 63 61 | value i|s logica|
|00004290| 6c 20 74 68 65 72 65 20 | 69 73 20 6e 6f 74 20 6d |l there |is not m|
|000042a0| 75 63 68 20 73 65 6e 73 | 65 20 69 6e 20 75 73 69 |uch sens|e in usi|
|000042b0| 6e 67 20 74 68 65 20 63 | 61 73 65 0a 63 6f 6e 73 |ng the c|ase.cons|
|000042c0| 74 72 75 63 74 20 69 6e | 73 74 65 61 64 20 6f 66 |truct in|stead of|
|000042d0| 20 61 6e 64 20 6f 72 64 | 69 6e 61 72 79 20 69 66 | and ord|inary if|
|000042e0| 2f 65 6c 73 65 2f 65 6e | 64 69 66 2e 20 20 41 6e |/else/en|dif. An|
|000042f0| 20 65 78 61 6d 70 6c 65 | 20 6f 66 20 61 20 0a 63 | example| of a .c|
|00004300| 61 73 65 20 63 6f 6e 73 | 74 72 75 63 74 20 69 73 |ase cons|truct is|
|00004310| 0a 0a 20 20 20 20 20 63 | 20 3d 20 67 65 74 63 68 |.. c| = getch|
|00004320| 61 72 28 29 09 3b 20 66 | 75 6e 63 74 69 6f 6e 20 |ar().; f|unction |
|00004330| 74 68 61 74 20 72 65 74 | 75 72 6e 73 20 61 20 63 |that ret|urns a c|
|00004340| 68 61 72 61 63 74 65 72 | 20 76 61 6c 75 65 0a 20 |haracter| value. |
|00004350| 20 20 20 20 63 61 73 65 | 20 28 20 63 20 29 0a 20 | case| ( c ). |
|00004360| 20 20 20 20 6f 66 20 28 | 20 27 71 27 20 29 20 20 | of (| 'q' ) |
|00004370| 20 63 61 6c 6c 20 65 78 | 69 74 0a 20 20 20 20 20 | call ex|it. |
|00004380| 6f 66 20 28 20 27 64 27 | 20 29 20 20 20 63 61 6c |of ( 'd'| ) cal|
|00004390| 6c 20 64 75 6d 70 0a 20 | 20 20 20 20 20 20 20 20 |l dump. | |
|000043a0| 20 20 20 20 20 20 20 20 | 20 63 6f 6e 74 69 6e 75 | | continu|
|000043b0| 65 5f 63 61 73 65 20 28 | 20 6e 6f 74 5f 64 6f 6e |e_case (| not_don|
|000043c0| 65 20 29 0a 20 20 20 20 | 20 64 65 66 61 75 6c 74 |e ). | default|
|000043d0| 20 20 20 20 20 20 77 72 | 69 74 65 28 2a 2c 2a 29 | wr|ite(*,*)|
|000043e0| 20 27 69 6c 6c 65 67 61 | 6c 20 63 68 61 72 61 63 | 'illega|l charac|
|000043f0| 74 65 72 2c 20 74 72 79 | 20 61 67 61 69 6e 27 0a |ter, try| again'.|
|00004400| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00004410| 20 20 63 6f 6e 74 69 6e | 75 65 5f 63 61 73 65 0a | contin|ue_case.|
|00004420| 20 20 20 20 20 65 6e 64 | 5f 63 61 73 65 0a 0a 49 | end|_case..I|
|00004430| 6e 20 74 68 69 73 20 65 | 78 61 6d 70 6c 65 20 74 |n this e|xample t|
|00004440| 68 65 20 63 6f 6e 74 69 | 6e 75 65 20 73 74 61 74 |he conti|nue stat|
|00004450| 65 6d 65 6e 74 73 20 70 | 61 73 73 20 63 6f 6e 74 |ements p|ass cont|
|00004460| 72 6f 6c 20 62 61 63 6b | 20 74 6f 20 74 68 65 20 |rol back| to the |
|00004470| 63 61 73 65 2c 20 73 6f | 0a 67 65 74 63 68 61 72 |case, so|.getchar|
|00004480| 20 69 73 20 6e 6f 74 20 | 72 65 65 76 61 6c 75 61 | is not |reevalua|
|00004490| 74 65 64 2e 20 20 49 66 | 20 67 65 74 63 68 61 72 |ted. If| getchar|
|000044a0| 28 29 20 77 65 72 65 20 | 70 75 74 20 69 6e 20 74 |() were |put in t|
|000044b0| 68 65 20 63 61 73 65 20 | 65 78 70 72 65 73 73 69 |he case |expressi|
|000044c0| 6f 6e 0a 68 6f 77 65 76 | 65 72 2c 20 69 74 20 77 |on.howev|er, it w|
|000044d0| 6f 75 6c 64 20 62 65 20 | 65 76 61 6c 75 61 74 65 |ould be |evaluate|
|000044e0| 64 20 66 6f 72 20 65 61 | 63 68 20 4f 46 20 73 74 |d for ea|ch OF st|
|000044f0| 61 74 65 6d 65 6e 74 20 | 61 73 0a 0a 20 20 20 20 |atement |as.. |
|00004500| 20 69 66 20 28 20 27 71 | 27 20 2e 65 71 2e 20 67 | if ( 'q|' .eq. g|
|00004510| 65 74 63 68 61 72 28 29 | 20 29 20 65 74 63 0a 0a |etchar()| ) etc..|
|00004520| 77 68 69 63 68 20 69 73 | 20 70 72 6f 62 61 62 6c |which is| probabl|
|00004530| 79 20 6e 6f 74 20 77 68 | 61 74 20 77 61 73 20 69 |y not wh|at was i|
|00004540| 6e 74 65 6e 64 65 64 2e | 20 20 54 68 65 72 65 66 |ntended.| Theref|
|00004550| 6f 72 65 2c 20 63 6f 6e | 74 69 6e 75 65 5f 63 61 |ore, con|tinue_ca|
|00004560| 73 65 20 69 73 20 72 61 | 74 68 65 72 0a 75 73 65 |se is ra|ther.use|
|00004570| 6c 65 73 73 20 68 65 72 | 65 20 75 6e 6c 65 73 73 |less her|e unless|
|00004580| 20 74 68 65 20 76 61 6c | 75 65 20 6f 66 20 76 61 | the val|ue of va|
|00004590| 72 69 61 62 6c 65 20 63 | 20 69 73 20 63 68 61 6e |riable c| is chan|
|000045a0| 67 65 64 20 62 79 20 74 | 68 65 20 4f 46 20 63 6c |ged by t|he OF cl|
|000045b0| 61 75 73 65 2e 0a 54 68 | 65 20 65 78 61 6d 70 6c |ause..Th|e exampl|
|000045c0| 65 20 77 69 6c 6c 20 77 | 72 69 74 65 20 69 6e 64 |e will w|rite ind|
|000045d0| 65 66 69 6e 69 74 65 6c | 79 20 69 66 20 61 6e 79 |efinitel|y if any|
|000045e0| 20 63 68 61 72 61 63 74 | 65 72 20 6f 74 68 65 72 | charact|er other|
|000045f0| 20 74 68 61 6e 20 71 20 | 6f 72 20 64 0a 69 73 20 | than q |or d.is |
|00004600| 65 6e 74 65 72 65 64 2e | 20 20 54 68 65 20 72 69 |entered.| The ri|
|00004610| 67 68 74 20 77 61 79 20 | 74 6f 20 64 6f 20 74 68 |ght way |to do th|
|00004620| 69 73 20 69 73 20 62 79 | 20 73 77 69 74 63 68 69 |is is by| switchi|
|00004630| 6e 67 20 74 68 65 20 31 | 73 74 20 32 20 6c 69 6e |ng the 1|st 2 lin|
|00004640| 65 73 3a 0a 0a 20 20 20 | 20 20 63 61 73 65 20 28 |es:.. | case (|
|00004650| 20 63 20 29 0a 20 20 20 | 20 20 63 20 3d 20 67 65 | c ). | c = ge|
|00004660| 74 63 68 61 72 28 29 09 | 3b 20 66 75 6e 63 74 69 |tchar().|; functi|
|00004670| 6f 6e 20 74 68 61 74 20 | 72 65 74 75 72 6e 73 20 |on that |returns |
|00004680| 61 20 63 68 61 72 61 63 | 74 65 72 20 76 61 6c 75 |a charac|ter valu|
|00004690| 65 0a 20 20 20 20 20 6f | 66 20 28 20 27 71 27 20 |e. o|f ( 'q' |
|000046a0| 29 20 20 20 63 61 6c 6c | 20 65 78 69 74 0a 20 20 |) call| exit. |
|000046b0| 20 20 20 20 20 20 20 20 | 20 2e 2e 2e 0a 20 20 20 | | .... |
|000046c0| 20 20 20 20 20 20 20 20 | 2e 2e 2e 0a 20 20 20 20 | |.... |
|000046d0| 20 65 6e 64 5f 63 61 73 | 65 0a 0a 54 68 69 73 20 | end_cas|e..This |
|000046e0| 77 69 6c 6c 20 65 76 61 | 6c 75 61 74 65 20 74 68 |will eva|luate th|
|000046f0| 65 20 66 75 6e 63 74 69 | 6f 6e 20 67 65 74 63 68 |e functi|on getch|
|00004700| 61 72 20 6f 6e 20 65 6e | 74 72 79 20 61 6e 64 20 |ar on en|try and |
|00004710| 6f 6e 63 65 20 65 76 65 | 72 79 20 74 69 6d 65 0a |once eve|ry time.|
|00004720| 63 6f 6e 74 69 6e 75 65 | 5f 63 61 73 65 20 69 73 |continue|_case is|
|00004730| 20 65 6e 63 6f 75 6e 74 | 65 72 65 64 2e 20 20 41 | encount|ered. A|
|00004740| 6e 20 65 78 61 6d 70 6c | 65 20 77 68 69 63 68 20 |n exampl|e which |
|00004750| 75 73 65 73 20 6c 6f 67 | 69 63 61 6c 20 65 78 70 |uses log|ical exp|
|00004760| 72 65 73 73 69 6f 6e 73 | 20 69 73 0a 0a 20 20 20 |ressions| is.. |
|00004770| 20 20 63 61 73 65 0a 20 | 20 20 20 20 63 20 3d 20 | case. | c = |
|00004780| 67 65 74 63 68 61 72 28 | 29 0a 20 20 20 20 20 6f |getchar(|). o|
|00004790| 66 20 28 20 27 71 27 20 | 3d 3d 20 63 20 29 20 63 |f ( 'q' |== c ) c|
|000047a0| 61 6c 6c 20 65 78 69 74 | 0a 20 20 20 20 20 20 20 |all exit|. |
|000047b0| 20 20 20 20 2e 2e 2e 0a | 20 20 20 20 20 65 6e 64 | ....| end|
|000047c0| 20 63 61 73 65 0a 0a 54 | 68 65 20 6e 65 73 74 69 | case..T|he nesti|
|000047d0| 6e 67 20 6c 69 6d 69 74 | 20 66 6f 72 20 63 61 73 |ng limit| for cas|
|000047e0| 65 20 63 6f 6e 73 74 72 | 75 63 74 73 20 69 73 20 |e constr|ucts is |
|000047f0| 61 67 61 69 6e 20 31 30 | 2e 20 20 49 66 20 63 6f |again 10|. If co|
|00004800| 6e 74 69 6e 75 65 5f 63 | 61 73 65 0a 69 73 20 74 |ntinue_c|ase.is t|
|00004810| 6f 6f 20 6c 6f 6e 67 20 | 61 20 63 6f 6d 6d 61 6e |oo long |a comman|
|00004820| 64 20 6e 61 6d 65 2c 20 | 69 74 20 63 61 6e 20 61 |d name, |it can a|
|00004830| 6c 77 61 79 73 20 62 65 | 20 61 62 62 72 65 76 69 |lways be| abbrevi|
|00004840| 61 74 65 64 20 77 69 74 | 68 20 61 20 6d 61 63 72 |ated wit|h a macr|
|00004850| 6f 0a 64 65 66 69 6e 69 | 74 69 6f 6e 20 28 69 6e |o.defini|tion (in|
|00004860| 20 70 72 65 70 6d 61 63 | 2e 68 20 74 68 65 20 64 | prepmac|.h the d|
|00004870| 65 66 69 6e 69 74 69 6f | 6e 20 22 3a 20 2d 3e 63 |efinitio|n ": ->c|
|00004880| 61 73 65 20 63 6f 6e 74 | 69 6e 75 65 5f 63 61 73 |ase cont|inue_cas|
|00004890| 65 20 3b 22 20 64 6f 65 | 73 0a 74 68 69 73 29 2e |e ;" doe|s.this).|
|000048a0| 0a 0a 0a 0a 20 64 6f 20 | 2e 2e 2e 20 65 6e 64 5f |.... do |... end_|
|000048b0| 64 6f 0a 0a 20 20 20 20 | 20 54 68 65 20 73 79 6e |do.. | The syn|
|000048c0| 74 61 78 20 68 65 72 65 | 20 69 73 20 6c 69 6b 65 |tax here| is like|
|000048d0| 20 74 68 61 74 20 6f 66 | 20 76 6d 73 20 66 6f 72 | that of| vms for|
|000048e0| 74 72 61 6e 2c 20 65 78 | 63 65 70 74 20 66 6f 72 |tran, ex|cept for|
|000048f0| 20 74 68 65 20 6c 65 61 | 76 65 5f 64 6f 0a 77 68 | the lea|ve_do.wh|
|00004900| 69 63 68 20 6a 75 6d 70 | 73 20 6f 75 74 20 6f 66 |ich jump|s out of|
|00004910| 20 74 68 65 20 6c 6f 6f | 70 20 69 66 20 74 68 65 | the loo|p if the|
|00004920| 20 6c 6f 67 69 63 61 6c | 20 65 78 70 72 65 73 73 | logical| express|
|00004930| 69 6f 6e 20 69 73 20 74 | 72 75 65 2c 20 61 6e 64 |ion is t|rue, and|
|00004940| 20 0a 63 6f 6e 74 69 6e | 75 65 5f 64 6f 20 77 68 | .contin|ue_do wh|
|00004950| 69 63 68 20 6a 75 6d 70 | 73 20 74 6f 20 74 68 65 |ich jump|s to the|
|00004960| 20 65 6e 64 5f 64 6f 20 | 61 6e 64 20 63 6f 6e 74 | end_do |and cont|
|00004970| 69 6e 75 65 73 20 74 68 | 65 20 6c 6f 6f 70 2e 20 |inues th|e loop. |
|00004980| 20 41 6e 0a 65 78 61 6d | 70 6c 65 3a 0a 0a 20 20 | An.exam|ple:.. |
|00004990| 20 20 20 64 6f 20 69 20 | 3d 20 31 2c 20 31 30 0a | do i |= 1, 10.|
|000049a0| 09 6c 69 6e 65 20 6f 66 | 20 63 6f 64 65 0a 20 20 |.line of| code. |
|000049b0| 20 20 20 63 6f 6e 74 69 | 6e 75 65 20 64 6f 20 28 | conti|nue do (|
|000049c0| 20 69 20 3d 3d 20 32 20 | 29 09 3b 20 67 6f 65 73 | i == 2 |).; goes|
|000049d0| 20 74 6f 20 65 6e 64 5f | 64 6f 20 69 66 20 74 72 | to end_|do if tr|
|000049e0| 75 65 0a 09 6c 69 6e 65 | 20 6f 66 20 63 6f 64 65 |ue..line| of code|
|000049f0| 0a 09 6c 69 6e 65 20 6f | 66 20 63 6f 64 65 0a 20 |..line o|f code. |
|00004a00| 20 20 20 20 6c 65 61 76 | 65 20 64 6f 20 28 20 69 | leav|e do ( i|
|00004a10| 2a 6a 20 3d 3d 20 34 20 | 29 09 3b 20 65 78 69 74 |*j == 4 |).; exit|
|00004a20| 73 20 6c 6f 6f 70 20 69 | 66 20 74 72 75 65 0a 09 |s loop i|f true..|
|00004a30| 6c 69 6e 65 20 6f 66 20 | 63 6f 64 65 0a 20 20 20 |line of |code. |
|00004a40| 20 20 65 6e 64 20 64 6f | 0a 0a 54 68 65 20 6c 65 | end do|..The le|
|00004a50| 61 76 65 5f 64 6f 20 61 | 6e 64 20 63 6f 6e 74 69 |ave_do a|nd conti|
|00004a60| 6e 75 65 5f 64 6f 20 63 | 6f 6d 6d 61 6e 64 73 20 |nue_do c|ommands |
|00004a70| 63 61 6e 6e 6f 74 20 62 | 65 20 75 73 65 64 20 69 |cannot b|e used i|
|00004a80| 6e 20 6e 6f 72 6d 61 6c | 20 6c 61 62 65 6c 65 64 |n normal| labeled|
|00004a90| 0a 64 6f 20 6c 6f 6f 70 | 73 2e 20 20 49 66 20 74 |.do loop|s. If t|
|00004aa0| 68 65 20 6c 6f 67 69 63 | 61 6c 20 65 78 70 72 65 |he logic|al expre|
|00004ab0| 73 73 69 6f 6e 73 20 61 | 72 65 20 6f 6d 69 74 74 |ssions a|re omitt|
|00004ac0| 65 64 20 74 68 65 79 20 | 61 72 65 20 61 73 73 75 |ed they |are assu|
|00004ad0| 6d 65 64 0a 74 72 75 65 | 2e 0a 0a 0a 0a 0a 56 65 |med.true|......Ve|
|00004ae0| 63 74 6f 72 20 41 72 69 | 74 68 6d 65 74 69 63 0a |ctor Ari|thmetic.|
|00004af0| 20 20 20 20 20 57 68 65 | 6e 20 77 72 69 74 69 6e | Whe|n writin|
|00004b00| 67 20 6c 61 72 67 65 20 | 6e 75 6d 62 65 72 20 63 |g large |number c|
|00004b10| 72 75 6e 63 68 69 6e 67 | 20 70 72 6f 67 72 61 6d |runching| program|
|00004b20| 73 20 69 6e 20 66 6f 72 | 74 72 61 6e 20 69 74 20 |s in for|tran it |
|00004b30| 6f 66 74 65 6e 0a 68 61 | 70 70 65 6e 73 20 74 68 |often.ha|ppens th|
|00004b40| 61 74 20 74 68 65 72 65 | 20 61 72 65 20 61 20 6c |at there| are a l|
|00004b50| 61 72 67 65 20 6e 75 6d | 62 65 72 20 6f 66 20 61 |arge num|ber of a|
|00004b60| 72 72 61 79 73 20 77 69 | 74 68 20 74 68 65 20 73 |rrays wi|th the s|
|00004b70| 61 6d 65 20 64 69 6d 65 | 6e 73 69 6f 6e 73 2e 0a |ame dime|nsions..|
|00004b80| 4d 6f 72 65 20 74 68 61 | 6e 20 6c 69 6b 65 6c 79 |More tha|n likely|
|00004b90| 20 74 68 65 20 6c 6f 6f | 70 20 70 61 72 61 6d 65 | the loo|p parame|
|00004ba0| 74 65 72 73 20 77 69 6c | 6c 20 62 65 20 74 68 65 |ters wil|l be the|
|00004bb0| 20 73 61 6d 65 20 66 6f | 72 20 6d 61 6e 79 20 6c | same fo|r many l|
|00004bc0| 6f 6f 70 73 2c 0a 61 6e | 64 20 65 76 65 6e 20 61 |oops,.an|d even a|
|00004bd0| 20 73 69 6d 70 6c 65 20 | 72 6f 75 74 69 6e 65 20 | simple |routine |
|00004be0| 6d 61 79 20 62 65 20 72 | 61 74 68 65 72 20 6c 6f |may be r|ather lo|
|00004bf0| 6e 67 20 61 6e 64 20 64 | 69 66 66 69 63 75 6c 74 |ng and d|ifficult|
|00004c00| 20 74 6f 20 72 65 61 64 | 0a 62 65 63 61 75 73 65 | to read|.because|
|00004c10| 20 6f 66 20 61 6c 6c 20 | 74 68 65 20 65 78 63 65 | of all |the exce|
|00004c20| 73 73 20 62 61 67 67 61 | 67 65 2e 20 20 49 74 20 |ss bagga|ge. It |
|00004c30| 69 73 20 74 68 65 72 65 | 66 6f 72 65 20 68 65 6c |is there|fore hel|
|00004c40| 70 66 75 6c 20 74 6f 20 | 68 61 76 65 0a 61 20 73 |pful to |have.a s|
|00004c50| 68 6f 72 74 68 61 6e 64 | 20 6d 65 74 68 6f 64 20 |horthand| method |
|00004c60| 66 6f 72 20 77 72 69 74 | 69 6e 67 20 6c 6f 6f 70 |for writ|ing loop|
|00004c70| 73 20 74 68 61 74 20 75 | 73 65 20 63 6f 6d 6d 6f |s that u|se commo|
|00004c80| 6e 20 6c 6f 6f 70 20 70 | 61 72 61 6d 65 74 65 72 |n loop p|arameter|
|00004c90| 73 2e 0a 20 20 20 20 20 | 41 20 66 65 77 20 65 78 |s.. |A few ex|
|00004ca0| 61 6d 70 6c 65 73 20 6f | 66 20 74 68 65 20 73 68 |amples o|f the sh|
|00004cb0| 6f 72 74 68 61 6e 64 20 | 73 75 70 70 6f 72 74 65 |orthand |supporte|
|00004cc0| 64 20 62 79 20 50 52 45 | 50 20 66 6f 6c 6c 6f 77 |d by PRE|P follow|
|00004cd0| 2e 0a 0a 09 61 28 23 2c | 23 29 20 3d 20 62 28 23 |....a(#,|#) = b(#|
|00004ce0| 2c 23 29 20 2b 20 31 0a | 0a 54 68 69 73 20 68 61 |,#) + 1.|.This ha|
|00004cf0| 73 20 74 68 65 20 6f 62 | 76 69 6f 75 73 20 6d 65 |s the ob|vious me|
|00004d00| 61 6e 69 6e 67 20 74 68 | 61 74 20 61 6c 6c 20 6f |aning th|at all o|
|00004d10| 66 20 74 68 65 20 65 6c | 65 6d 65 6e 74 73 20 6f |f the el|ements o|
|00004d20| 66 20 61 72 72 61 79 20 | 61 20 61 72 65 0a 73 65 |f array |a are.se|
|00004d30| 74 20 65 71 75 61 6c 20 | 74 6f 20 74 68 6f 73 65 |t equal |to those|
|00004d40| 20 6f 66 20 62 20 69 6e | 63 72 65 6d 65 6e 74 65 | of b in|cremente|
|00004d50| 64 20 62 79 20 31 2e 20 | 20 41 73 73 75 6d 69 6e |d by 1. | Assumin|
|00004d60| 67 20 74 68 65 20 61 70 | 70 72 6f 70 72 69 61 74 |g the ap|propriat|
|00004d70| 65 0a 64 65 66 61 75 6c | 74 20 6c 6f 6f 70 20 70 |e.defaul|t loop p|
|00004d80| 61 72 61 6d 65 74 65 72 | 73 20 68 61 76 65 20 62 |arameter|s have b|
|00004d90| 65 65 6e 20 73 65 74 2c | 20 74 68 69 73 20 77 69 |een set,| this wi|
|00004da0| 6c 6c 20 62 65 20 65 78 | 70 61 6e 64 65 64 20 61 |ll be ex|panded a|
|00004db0| 73 0a 0a 09 64 6f 20 31 | 30 30 30 31 20 69 30 30 |s...do 1|0001 i00|
|00004dc0| 31 20 3d 20 31 2c 20 6d | 79 0a 09 64 6f 20 31 30 |1 = 1, m|y..do 10|
|00004dd0| 30 30 30 20 69 30 30 30 | 20 3d 20 31 2c 20 6d 78 |000 i000| = 1, mx|
|00004de0| 0a 09 61 28 69 30 30 30 | 2c 69 30 30 31 29 20 3d |..a(i000|,i001) =|
|00004df0| 20 62 28 69 30 30 30 2c | 69 30 30 31 29 20 2b 20 | b(i000,|i001) + |
|00004e00| 31 0a 31 30 30 30 30 09 | 63 6f 6e 74 69 6e 75 65 |1.10000.|continue|
|00004e10| 0a 31 30 30 30 31 09 63 | 6f 6e 74 69 6e 75 65 0a |.10001.c|ontinue.|
|00004e20| 0a 54 68 65 20 6c 61 62 | 65 6c 73 20 77 69 6c 6c |.The lab|els will|
|00004e30| 20 62 65 20 67 65 6e 65 | 72 61 74 65 64 20 75 6e | be gene|rated un|
|00004e40| 69 71 75 65 6c 79 2e 20 | 20 54 68 65 20 76 61 72 |iquely. | The var|
|00004e50| 69 61 62 6c 65 73 20 69 | 30 30 30 20 2d 3e 20 69 |iables i|000 -> i|
|00004e60| 30 30 39 20 61 72 65 0a | 72 65 73 65 72 76 65 64 |009 are.|reserved|
|00004e70| 20 66 6f 72 20 74 68 69 | 73 20 70 75 72 70 6f 73 | for thi|s purpos|
|00004e80| 65 2e 20 20 50 52 45 50 | 20 61 73 73 75 6d 65 73 |e. PREP| assumes|
|00004e90| 20 74 68 61 74 20 74 68 | 65 20 75 73 75 61 6c 20 | that th|e usual |
|00004ea0| 66 6f 72 74 72 61 6e 20 | 0a 63 6f 6e 76 65 6e 74 |fortran |.convent|
|00004eb0| 69 6f 6e 73 20 68 6f 6c | 64 20 61 6e 64 20 74 68 |ions hol|d and th|
|00004ec0| 61 74 20 76 61 72 69 61 | 62 6c 65 73 20 62 65 67 |at varia|bles beg|
|00004ed0| 69 6e 6e 69 6e 67 20 77 | 69 74 68 20 69 20 61 72 |inning w|ith i ar|
|00004ee0| 65 20 69 6e 74 65 67 65 | 72 73 2e 0a 49 6e 20 66 |e intege|rs..In f|
|00004ef0| 6f 72 74 72 61 6e 20 74 | 68 65 20 66 69 72 73 74 |ortran t|he first|
|00004f00| 20 69 6e 64 65 78 20 6f | 66 20 61 6e 20 61 72 72 | index o|f an arr|
|00004f10| 61 79 20 63 68 61 6e 67 | 65 73 20 74 68 65 20 6d |ay chang|es the m|
|00004f20| 6f 73 74 20 72 61 70 69 | 64 6c 79 20 61 73 0a 6f |ost rapi|dly as.o|
|00004f30| 6e 65 20 70 72 6f 63 65 | 65 64 73 20 74 68 72 6f |ne proce|eds thro|
|00004f40| 75 67 68 20 74 68 65 20 | 6d 65 6d 6f 72 79 2c 20 |ugh the |memory, |
|00004f50| 73 6f 20 74 68 65 20 6c | 6f 6f 70 73 20 61 72 65 |so the l|oops are|
|00004f60| 20 61 6c 77 61 79 73 20 | 67 65 6e 65 72 61 74 65 | always |generate|
|00004f70| 64 0a 77 69 74 68 20 74 | 68 65 20 69 6e 6e 65 72 |d.with t|he inner|
|00004f80| 6d 6f 73 74 20 6c 6f 6f | 70 20 6f 76 65 72 20 74 |most loo|p over t|
|00004f90| 68 65 20 66 69 72 73 74 | 20 69 6e 64 65 78 2e 20 |he first| index. |
|00004fa0| 20 54 68 69 73 20 69 73 | 20 65 73 73 65 6e 74 69 | This is| essenti|
|00004fb0| 61 6c 20 66 6f 72 0a 65 | 66 66 69 63 69 65 6e 63 |al for.e|fficienc|
|00004fc0| 79 20 6f 6e 20 6d 61 63 | 68 69 6e 65 73 20 77 69 |y on mac|hines wi|
|00004fd0| 74 68 20 76 69 72 74 75 | 61 6c 20 6d 65 6d 6f 72 |th virtu|al memor|
|00004fe0| 79 20 28 56 41 58 29 20 | 6f 72 20 74 68 6f 73 65 |y (VAX) |or those|
|00004ff0| 20 74 68 61 74 20 72 65 | 6c 79 0a 6f 6e 20 73 65 | that re|ly.on se|
|00005000| 71 75 65 6e 74 69 61 6c | 20 61 64 64 72 65 73 73 |quential| address|
|00005010| 69 6e 67 20 66 6f 72 20 | 76 65 63 74 6f 72 69 7a |ing for |vectoriz|
|00005020| 61 74 69 6f 6e 20 28 43 | 79 62 65 72 29 2e 0a 20 |ation (C|yber).. |
|00005030| 20 20 20 20 4d 6f 72 65 | 20 74 68 61 6e 20 6f 6e | More| than on|
|00005040| 65 20 6c 69 6e 65 20 63 | 61 6e 20 62 65 20 70 6c |e line c|an be pl|
|00005050| 61 63 65 64 20 69 6e 20 | 74 68 65 20 63 6f 72 65 |aced in |the core|
|00005060| 20 6f 66 20 61 20 6c 6f | 6f 70 20 62 79 20 75 73 | of a lo|op by us|
|00005070| 69 6e 67 0a 73 71 75 61 | 72 65 20 62 72 61 63 6b |ing.squa|re brack|
|00005080| 65 74 73 20 74 6f 20 67 | 72 6f 75 70 20 74 68 65 |ets to g|roup the|
|00005090| 6d 20 74 6f 67 65 74 68 | 65 72 2e 0a 0a 09 63 28 |m togeth|er....c(|
|000050a0| 23 2c 23 29 20 3d 20 65 | 78 70 28 20 64 28 23 2c |#,#) = e|xp( d(#,|
|000050b0| 23 29 20 29 20 2b 20 63 | 28 23 2c 23 29 0a 5b 09 |#) ) + c|(#,#).[.|
|000050c0| 61 28 23 2c 23 29 20 3d | 20 62 28 23 2c 23 2c 31 |a(#,#) =| b(#,#,1|
|000050d0| 29 2a 63 28 23 2c 23 29 | 20 2d 20 31 30 30 0a 09 |)*c(#,#)| - 100..|
|000050e0| 78 20 3d 20 79 0a 09 64 | 28 23 2c 23 29 20 3d 20 |x = y..d|(#,#) = |
|000050f0| 65 28 23 2c 23 29 20 09 | 09 5d 0a 0a 69 73 20 65 |e(#,#) .|.]..is e|
|00005100| 78 70 61 6e 64 65 64 20 | 61 73 0a 0a 09 64 6f 20 |xpanded |as...do |
|00005110| 31 30 30 30 31 20 69 30 | 30 31 20 3d 20 31 2c 20 |10001 i0|01 = 1, |
|00005120| 6d 79 0a 09 64 6f 20 31 | 30 30 30 30 20 69 30 30 |my..do 1|0000 i00|
|00005130| 30 20 3d 20 31 2c 20 6d | 78 0a 09 63 28 69 30 30 |0 = 1, m|x..c(i00|
|00005140| 30 2c 20 69 30 30 31 29 | 20 3d 20 65 78 70 28 20 |0, i001)| = exp( |
|00005150| 64 28 69 30 30 30 2c 69 | 30 30 31 29 20 29 20 2b |d(i000,i|001) ) +|
|00005160| 20 63 28 69 30 30 30 2c | 69 30 30 31 29 0a 31 30 | c(i000,|i001).10|
|00005170| 30 30 30 09 63 6f 6e 74 | 69 6e 75 65 0a 31 30 30 |000.cont|inue.100|
|00005180| 30 31 09 63 6f 6e 74 69 | 6e 75 65 0a 09 64 6f 20 |01.conti|nue..do |
|00005190| 31 30 30 30 33 20 69 30 | 30 31 20 3d 20 31 2c 20 |10003 i0|01 = 1, |
|000051a0| 6d 79 0a 09 64 6f 20 31 | 30 30 30 32 20 69 30 30 |my..do 1|0002 i00|
|000051b0| 30 20 3d 20 31 2c 20 6d | 78 0a 09 61 28 69 30 30 |0 = 1, m|x..a(i00|
|000051c0| 30 2c 69 30 30 31 29 20 | 3d 20 62 28 69 30 30 30 |0,i001) |= b(i000|
|000051d0| 2c 69 30 30 31 2c 31 29 | 2a 63 28 69 30 30 30 2c |,i001,1)|*c(i000,|
|000051e0| 69 30 30 31 29 20 2d 20 | 31 30 30 0a 09 78 20 3d |i001) - |100..x =|
|000051f0| 20 79 0a 09 64 28 69 30 | 30 30 2c 69 30 30 31 29 | y..d(i0|00,i001)|
|00005200| 20 3d 20 65 28 69 30 30 | 30 2c 69 30 30 31 29 0a | = e(i00|0,i001).|
|00005210| 31 30 30 30 32 09 63 6f | 6e 74 69 6e 75 65 0a 31 |10002.co|ntinue.1|
|00005220| 30 30 30 33 09 63 6f 6e | 74 69 6e 75 65 0a 0a 59 |0003.con|tinue..Y|
|00005230| 65 73 20 74 68 65 20 6f | 75 74 70 75 74 20 63 61 |es the o|utput ca|
|00005240| 6e 20 67 65 74 20 76 65 | 72 79 20 75 67 6c 79 2c |n get ve|ry ugly,|
|00005250| 20 62 75 74 20 63 6f 6d | 70 75 74 65 72 73 20 64 | but com|puters d|
|00005260| 6f 6e 27 74 20 63 61 72 | 65 2e 20 20 50 52 45 50 |on't car|e. PREP|
|00005270| 20 77 69 6c 6c 20 0a 61 | 6c 77 61 79 73 20 63 6f | will .a|lways co|
|00005280| 6e 74 69 6e 75 65 20 74 | 6f 20 74 68 65 20 6e 65 |ntinue t|o the ne|
|00005290| 78 74 20 6c 69 6e 65 20 | 69 66 20 6e 65 63 65 73 |xt line |if neces|
|000052a0| 73 61 72 79 20 73 6f 20 | 74 68 65 72 65 20 69 73 |sary so |there is|
|000052b0| 20 6e 6f 20 6e 65 65 64 | 0a 74 6f 20 77 6f 72 72 | no need|.to worr|
|000052c0| 79 20 61 62 6f 75 74 20 | 6c 69 6e 65 20 6c 65 6e |y about |line len|
|000052d0| 67 74 68 2e 0a 20 20 20 | 20 54 68 65 20 61 62 6f |gth.. | The abo|
|000052e0| 76 65 20 6c 6f 6f 70 73 | 20 75 73 65 20 64 65 66 |ve loops| use def|
|000052f0| 61 75 6c 74 20 6c 6f 6f | 70 20 6c 69 6d 69 74 73 |ault loo|p limits|
|00005300| 2c 20 61 6e 64 20 74 68 | 65 73 65 20 6d 75 73 74 |, and th|ese must|
|00005310| 20 62 65 20 73 65 74 0a | 77 69 74 68 20 74 68 65 | be set.|with the|
|00005320| 20 64 6f 5f 6c 69 6d 69 | 74 73 20 63 6f 6d 6d 61 | do_limi|ts comma|
|00005330| 6e 64 2e 20 20 54 68 65 | 20 67 65 6e 65 72 61 6c |nd. The| general|
|00005340| 20 66 6f 72 6d 20 69 73 | 3a 0a 0a 64 6f 5f 6c 69 | form is|:..do_li|
|00005350| 6d 69 74 73 20 5b 20 28 | 6d 69 2c 20 6d 66 2c 20 |mits [ (|mi, mf, |
|00005360| 6d 69 6e 63 29 2c 20 28 | 6e 69 2c 20 6e 66 2c 20 |minc), (|ni, nf, |
|00005370| 6e 69 6e 63 29 2c 20 2e | 2e 2e 2e 20 5d 0a 0a 54 |ninc), .|... ]..T|
|00005380| 68 65 20 6e 75 6d 62 65 | 72 20 6f 66 20 74 72 69 |he numbe|r of tri|
|00005390| 70 6c 65 73 20 28 64 6f | 20 69 30 30 30 3d 6d 69 |ples (do| i000=mi|
|000053a0| 2c 20 6d 66 2c 20 6d 69 | 6e 63 29 20 64 65 74 65 |, mf, mi|nc) dete|
|000053b0| 72 6d 69 6e 65 73 20 68 | 6f 77 20 6d 61 6e 79 0a |rmines h|ow many.|
|000053c0| 69 6e 64 69 63 65 73 20 | 77 69 6c 6c 20 62 65 20 |indices |will be |
|000053d0| 6c 6f 6f 70 65 64 20 6f | 76 65 72 2e 20 20 49 66 |looped o|ver. If|
|000053e0| 20 61 20 74 72 69 70 6c | 65 20 68 61 73 20 6f 6e | a tripl|e has on|
|000053f0| 6c 79 20 32 20 65 6c 65 | 6d 65 6e 74 73 20 74 68 |ly 2 ele|ments th|
|00005400| 65 79 20 61 72 65 0a 61 | 73 73 75 6d 65 64 20 74 |ey are.a|ssumed t|
|00005410| 6f 20 62 65 20 74 68 65 | 20 69 6e 69 74 69 61 6c |o be the| initial|
|00005420| 20 76 61 6c 75 65 20 61 | 6e 64 20 66 69 6e 61 6c | value a|nd final|
|00005430| 20 76 61 6c 75 65 20 61 | 6e 64 20 74 68 65 20 69 | value a|nd the i|
|00005440| 6e 63 72 65 6d 65 6e 74 | 20 69 73 0a 74 61 6b 65 |ncrement| is.take|
|00005450| 6e 20 74 6f 20 62 65 20 | 31 2e 20 20 49 66 20 61 |n to be |1. If a|
|00005460| 20 74 72 69 70 6c 65 20 | 68 61 73 20 6a 75 73 74 | triple |has just|
|00005470| 20 6f 6e 65 20 65 6c 65 | 6d 65 6e 74 20 28 70 61 | one ele|ment (pa|
|00005480| 72 65 6e 73 20 74 68 65 | 6e 20 6e 6f 74 20 6e 65 |rens the|n not ne|
|00005490| 65 64 65 64 29 0a 69 74 | 20 69 73 20 61 73 73 75 |eded).it| is assu|
|000054a0| 6d 65 64 20 74 6f 20 62 | 65 20 74 68 65 20 66 69 |med to b|e the fi|
|000054b0| 6e 61 6c 20 76 61 6c 75 | 65 20 61 6e 64 20 74 68 |nal valu|e and th|
|000054c0| 65 20 69 6e 69 74 69 61 | 6c 20 76 61 6c 75 65 20 |e initia|l value |
|000054d0| 61 6e 64 20 69 6e 63 72 | 65 6d 65 6e 74 0a 61 72 |and incr|ement.ar|
|000054e0| 65 20 62 6f 74 68 20 74 | 61 6b 65 6e 20 74 6f 20 |e both t|aken to |
|000054f0| 62 65 20 31 2e 20 20 54 | 68 65 72 65 66 6f 72 65 |be 1. T|herefore|
|00005500| 20 74 68 65 20 61 62 6f | 76 65 20 65 78 61 6d 70 | the abo|ve examp|
|00005510| 6c 65 73 20 63 6f 75 6c | 64 20 68 61 76 65 20 74 |les coul|d have t|
|00005520| 68 65 69 72 0a 6c 69 6d | 69 74 73 20 73 65 74 20 |heir.lim|its set |
|00005530| 77 69 74 68 0a 0a 64 6f | 5f 6c 69 6d 69 74 73 20 |with..do|_limits |
|00005540| 5b 20 6d 78 2c 20 6d 79 | 20 5d 0a 0a 55 73 75 61 |[ mx, my| ]..Usua|
|00005550| 6c 6c 79 20 74 68 65 20 | 64 6f 5f 6c 69 6d 69 74 |lly the |do_limit|
|00005560| 73 20 73 74 61 74 65 6d | 65 6e 74 20 77 69 6c 6c |s statem|ent will|
|00005570| 20 62 65 20 74 75 63 6b | 65 64 20 6f 75 74 20 6f | be tuck|ed out o|
|00005580| 66 20 74 68 65 20 77 61 | 79 20 61 74 20 74 68 65 |f the wa|y at the|
|00005590| 0a 62 65 67 69 6e 6e 69 | 6e 67 20 6f 66 20 74 68 |.beginni|ng of th|
|000055a0| 65 20 70 72 6f 67 72 61 | 6d 20 66 69 6c 65 20 6f |e progra|m file o|
|000055b0| 72 20 69 6e 20 61 20 50 | 52 45 50 20 23 69 6e 63 |r in a P|REP #inc|
|000055c0| 6c 75 64 65 20 66 69 6c | 65 2e 20 20 41 67 61 69 |lude fil|e. Agai|
|000055d0| 6e 20 74 68 65 0a 75 6e | 64 65 72 6c 69 6e 65 20 |n the.un|derline |
|000055e0| 63 61 6e 20 62 65 20 72 | 65 70 6c 61 63 65 64 20 |can be r|eplaced |
|000055f0| 62 79 20 61 20 62 6c 61 | 6e 6b 2e 0a 20 20 20 20 |by a bla|nk.. |
|00005600| 20 41 73 20 61 20 72 75 | 6c 65 20 74 68 65 20 6e | As a ru|le the n|
|00005610| 75 6d 62 65 72 20 6f 66 | 20 23 20 73 79 6d 62 6f |umber of| # symbo|
|00005620| 6c 73 20 69 6e 20 65 61 | 63 68 20 61 72 72 61 79 |ls in ea|ch array|
|00005630| 20 73 68 6f 75 6c 64 20 | 65 71 75 61 6c 20 74 68 | should |equal th|
|00005640| 65 0a 6e 75 6d 62 65 72 | 20 6f 66 20 69 6e 64 69 |e.number| of indi|
|00005650| 63 65 73 20 69 6d 70 6c | 69 65 64 20 62 79 20 74 |ces impl|ied by t|
|00005660| 68 65 20 63 75 72 72 65 | 6e 74 20 64 65 66 61 75 |he curre|nt defau|
|00005670| 6c 74 20 6c 69 6d 69 74 | 73 2e 20 20 41 20 63 6f |lt limit|s. A co|
|00005680| 6d 6d 6f 6e 0a 65 78 63 | 65 70 74 69 6f 6e 20 69 |mmon.exc|eption i|
|00005690| 73 0a 0a 09 61 28 23 29 | 20 3d 20 61 28 23 29 20 |s...a(#)| = a(#) |
|000056a0| 2b 20 62 28 23 2c 23 29 | 2a 63 28 23 2c 23 29 0a |+ b(#,#)|*c(#,#).|
|000056b0| 0a 77 68 69 63 68 20 65 | 78 70 61 6e 64 73 20 61 |.which e|xpands a|
|000056c0| 73 0a 0a 09 64 6f 20 31 | 30 30 30 31 20 69 30 30 |s...do 1|0001 i00|
|000056d0| 31 20 3d 20 31 2c 20 6d | 79 0a 09 64 6f 20 31 30 |1 = 1, m|y..do 10|
|000056e0| 30 30 30 20 69 30 30 30 | 20 3d 20 31 2c 20 6d 78 |000 i000| = 1, mx|
|000056f0| 0a 09 61 28 69 30 30 30 | 29 20 3d 20 61 28 69 30 |..a(i000|) = a(i0|
|00005700| 30 30 29 20 2b 20 62 28 | 69 30 30 30 2c 69 30 30 |00) + b(|i000,i00|
|00005710| 31 29 2a 63 28 69 30 30 | 30 2c 69 30 30 31 29 0a |1)*c(i00|0,i001).|
|00005720| 31 30 30 30 30 09 63 6f | 6e 74 69 6e 75 65 0a 31 |10000.co|ntinue.1|
|00005730| 30 30 30 31 09 63 6f 6e | 74 69 6e 75 65 0a 0a 54 |0001.con|tinue..T|
|00005740| 68 69 73 20 64 6f 65 73 | 20 61 20 6c 6f 74 20 6f |his does| a lot o|
|00005750| 66 20 64 6f 74 20 70 72 | 6f 64 75 63 74 73 20 69 |f dot pr|oducts i|
|00005760| 6e 20 70 61 72 61 6c 6c | 65 6c 20 6f 6e 20 61 20 |n parall|el on a |
|00005770| 76 65 63 74 6f 72 20 6d | 61 63 68 69 6e 65 20 6c |vector m|achine l|
|00005780| 69 6b 65 0a 74 68 65 20 | 43 72 61 79 2e 20 20 54 |ike.the |Cray. T|
|00005790| 68 65 20 63 6f 6d 70 69 | 6c 65 72 20 77 69 6c 6c |he compi|ler will|
|000057a0| 20 76 65 63 74 6f 72 69 | 7a 65 20 74 68 65 20 69 | vectori|ze the i|
|000057b0| 6e 6e 65 72 20 6c 6f 6f | 70 2c 20 62 75 74 20 69 |nner loo|p, but i|
|000057c0| 73 20 6e 6f 74 20 0a 73 | 6d 61 72 74 20 65 6e 6f |s not .s|mart eno|
|000057d0| 75 67 68 20 74 6f 20 72 | 65 61 6c 69 7a 65 20 74 |ugh to r|ealize t|
|000057e0| 68 61 74 20 74 68 65 20 | 76 65 63 74 6f 72 20 61 |hat the |vector a|
|000057f0| 20 73 68 6f 75 6c 64 20 | 62 65 20 6b 65 70 74 20 | should |be kept |
|00005800| 69 6e 20 61 20 76 65 63 | 74 6f 72 0a 72 65 67 69 |in a vec|tor.regi|
|00005810| 73 74 65 72 20 66 72 6f | 6d 20 6f 6e 65 20 6f 75 |ster fro|m one ou|
|00005820| 74 65 72 20 69 74 65 72 | 61 74 69 6f 6e 20 74 6f |ter iter|ation to|
|00005830| 20 74 68 65 20 6e 65 78 | 74 2c 20 61 6e 64 20 64 | the nex|t, and d|
|00005840| 6f 65 73 20 61 6e 20 75 | 6e 6e 65 63 65 73 73 61 |oes an u|nnecessa|
|00005850| 72 79 0a 73 61 76 65 20 | 61 6e 64 20 66 65 74 63 |ry.save |and fetc|
|00005860| 68 20 65 61 63 68 20 74 | 69 6d 65 2e 20 20 42 65 |h each t|ime. Be|
|00005870| 63 61 75 73 65 20 74 68 | 69 73 20 6c 6f 6f 70 20 |cause th|is loop |
|00005880| 69 73 20 6d 65 6d 6f 72 | 79 20 62 6f 75 6e 64 20 |is memor|y bound |
|00005890| 28 74 68 65 0a 70 65 72 | 66 6f 72 6d 61 6e 63 65 |(the.per|formance|
|000058a0| 20 69 73 20 6c 69 6d 69 | 74 65 64 20 62 79 20 74 | is limi|ted by t|
|000058b0| 68 65 20 74 69 6d 65 20 | 69 74 20 74 61 6b 65 73 |he time |it takes|
|000058c0| 20 74 6f 20 66 65 74 63 | 68 20 61 6e 64 20 73 74 | to fetc|h and st|
|000058d0| 6f 72 65 20 74 68 65 0a | 64 61 74 61 20 72 61 74 |ore the.|data rat|
|000058e0| 68 65 72 20 74 68 61 6e | 20 74 68 65 20 66 6c 6f |her than| the flo|
|000058f0| 61 74 69 6e 67 20 70 6f | 69 6e 74 20 73 70 65 65 |ating po|int spee|
|00005900| 64 20 6f 66 20 74 68 65 | 20 6d 61 63 68 69 6e 65 |d of the| machine|
|00005910| 20 62 65 63 61 75 73 65 | 0a 74 68 65 72 65 20 61 | because|.there a|
|00005920| 72 65 20 73 6f 20 66 65 | 77 20 6f 70 65 72 61 74 |re so fe|w operat|
|00005930| 69 6f 6e 73 20 69 6e 20 | 74 68 65 20 6c 6f 6f 70 |ions in |the loop|
|00005940| 29 20 74 68 65 20 70 65 | 72 66 6f 72 6d 61 6e 63 |) the pe|rformanc|
|00005950| 65 20 63 61 6e 20 62 65 | 20 0a 69 6e 63 72 65 61 |e can be| .increa|
|00005960| 73 65 64 20 62 79 20 75 | 6e 72 6f 6c 6c 69 6e 67 |sed by u|nrolling|
|00005970| 20 74 68 65 20 6c 6f 6f | 70 2e 20 20 54 68 69 73 | the loo|p. This|
|00005980| 20 69 73 20 64 6f 6e 65 | 20 61 75 74 6f 6d 61 74 | is done| automat|
|00005990| 69 63 61 6c 6c 79 20 62 | 79 20 50 52 45 50 0a 74 |ically b|y PREP.t|
|000059a0| 6f 20 61 6e 79 20 64 65 | 70 74 68 2e 20 20 55 6e |o any de|pth. Un|
|000059b0| 72 6f 6c 6c 69 6e 67 20 | 74 68 69 73 20 65 78 61 |rolling |this exa|
|000059c0| 6d 70 6c 65 20 74 6f 20 | 61 20 64 65 70 74 68 20 |mple to |a depth |
|000059d0| 6f 66 20 34 20 67 69 76 | 65 73 0a 0a 20 20 20 20 |of 4 giv|es.. |
|000059e0| 20 20 64 6f 20 31 30 30 | 30 31 20 69 30 30 31 3d | do 100|01 i001=|
|000059f0| 31 2c 69 6e 74 28 28 31 | 2e 30 2a 28 28 20 6d 79 |1,int((1|.0*(( my|
|00005a00| 20 29 2d 31 2b 31 29 29 | 2f 28 31 2a 34 29 29 2a | )-1+1))|/(1*4))*|
|00005a10| 31 2a 34 2b 31 2d 31 2c | 31 2a 34 0a 20 20 20 20 |1*4+1-1,|1*4. |
|00005a20| 20 20 64 6f 20 31 30 30 | 30 30 20 69 30 30 30 20 | do 100|00 i000 |
|00005a30| 3d 20 31 2c 20 28 20 6d | 78 29 2c 20 31 0a 20 20 |= 1, ( m|x), 1. |
|00005a40| 20 20 20 20 61 28 69 30 | 30 30 29 20 3d 20 61 28 | a(i0|00) = a(|
|00005a50| 69 30 30 30 29 20 2b 20 | 62 28 69 30 30 30 2c 69 |i000) + |b(i000,i|
|00005a60| 30 30 31 29 2a 63 28 69 | 30 30 30 2c 69 30 30 31 |001)*c(i|000,i001|
|00005a70| 29 0a 20 20 20 20 20 20 | 61 28 69 30 30 30 29 20 |). |a(i000) |
|00005a80| 3d 20 61 28 69 30 30 30 | 29 20 2b 20 62 28 69 30 |= a(i000|) + b(i0|
|00005a90| 30 30 2c 69 30 30 31 2b | 31 2a 31 29 2a 63 28 69 |00,i001+|1*1)*c(i|
|00005aa0| 30 30 30 2c 69 30 30 31 | 2b 31 2a 31 29 0a 20 20 |000,i001|+1*1). |
|00005ab0| 20 20 20 20 61 28 69 30 | 30 30 29 20 3d 20 61 28 | a(i0|00) = a(|
|00005ac0| 69 30 30 30 29 20 2b 20 | 62 28 69 30 30 30 2c 69 |i000) + |b(i000,i|
|00005ad0| 30 30 31 2b 31 2a 32 29 | 2a 63 28 69 30 30 30 2c |001+1*2)|*c(i000,|
|00005ae0| 69 30 30 31 2b 31 2a 32 | 29 0a 20 20 20 20 20 20 |i001+1*2|). |
|00005af0| 61 28 69 30 30 30 29 20 | 3d 20 61 28 69 30 30 30 |a(i000) |= a(i000|
|00005b00| 29 20 2b 20 62 28 69 30 | 30 30 2c 69 30 30 31 2b |) + b(i0|00,i001+|
|00005b10| 31 2a 33 29 2a 63 28 69 | 30 30 30 2c 69 30 30 31 |1*3)*c(i|000,i001|
|00005b20| 2b 31 2a 33 29 0a 31 30 | 30 30 30 20 63 6f 6e 74 |+1*3).10|000 cont|
|00005b30| 69 6e 75 65 0a 31 30 30 | 30 31 20 63 6f 6e 74 69 |inue.100|01 conti|
|00005b40| 6e 75 65 0a 20 20 20 20 | 20 20 64 6f 20 31 30 30 |nue. | do 100|
|00005b50| 30 33 20 69 30 30 31 3d | 69 6e 74 28 28 31 2e 30 |03 i001=|int((1.0|
|00005b60| 2a 28 28 20 6d 79 20 29 | 2d 31 2b 31 29 29 2f 28 |*(( my )|-1+1))/(|
|00005b70| 31 2a 34 29 29 2a 31 2a | 34 2b 31 2c 28 20 6d 79 |1*4))*1*|4+1,( my|
|00005b80| 20 29 2c 31 0a 20 20 20 | 20 20 20 64 6f 20 31 30 | ),1. | do 10|
|00005b90| 30 30 32 20 69 30 30 30 | 20 3d 20 31 2c 20 28 20 |002 i000| = 1, ( |
|00005ba0| 6d 78 29 2c 20 31 0a 20 | 20 20 20 20 20 61 28 69 |mx), 1. | a(i|
|00005bb0| 30 30 30 29 20 3d 20 61 | 28 69 30 30 30 29 20 2b |000) = a|(i000) +|
|00005bc0| 20 62 28 69 30 30 30 2c | 69 30 30 31 29 2a 63 28 | b(i000,|i001)*c(|
|00005bd0| 69 30 30 30 2c 69 30 30 | 31 29 0a 31 30 30 30 32 |i000,i00|1).10002|
|00005be0| 20 63 6f 6e 74 69 6e 75 | 65 0a 31 30 30 30 33 20 | continu|e.10003 |
|00005bf0| 63 6f 6e 74 69 6e 75 65 | 0a 0a 54 68 65 20 73 65 |continue|..The se|
|00005c00| 63 6f 6e 64 20 73 65 74 | 20 6f 66 20 6c 6f 6f 70 |cond set| of loop|
|00005c10| 73 20 69 73 20 61 20 63 | 6c 65 61 6e 20 75 70 20 |s is a c|lean up |
|00005c20| 6f 70 65 72 61 74 69 6f | 6e 2e 20 20 54 68 69 73 |operatio|n. This|
|00005c30| 20 74 65 63 68 6e 69 71 | 75 65 0a 69 6d 70 72 6f | techniq|ue.impro|
|00005c40| 76 65 73 20 70 65 72 66 | 6f 72 6d 61 6e 63 65 20 |ves perf|ormance |
|00005c50| 62 65 63 61 75 73 65 20 | 6e 6f 77 20 74 68 65 20 |because |now the |
|00005c60| 63 6f 6d 70 69 6c 65 72 | 20 77 69 6c 6c 20 73 65 |compiler| will se|
|00005c70| 65 20 74 68 61 74 20 74 | 68 65 0a 73 61 6d 65 20 |e that t|he.same |
|00005c80| 76 65 63 74 6f 72 20 77 | 69 6c 6c 20 62 65 20 75 |vector w|ill be u|
|00005c90| 73 65 64 20 69 6e 20 74 | 68 65 20 6e 65 78 74 20 |sed in t|he next |
|00005ca0| 76 65 63 74 6f 72 20 73 | 74 61 74 65 6d 65 6e 74 |vector s|tatement|
|00005cb0| 20 61 6e 64 20 74 68 65 | 72 65 66 6f 72 65 0a 6b | and the|refore.k|
|00005cc0| 65 65 70 73 20 69 74 20 | 69 6e 20 61 20 72 65 67 |eeps it |in a reg|
|00005cd0| 69 73 74 65 72 2e 20 20 | 54 68 65 20 65 78 61 6d |ister. |The exam|
|00005ce0| 70 6c 65 20 61 62 6f 76 | 65 20 77 68 69 63 68 20 |ple abov|e which |
|00005cf0| 69 73 20 6e 6f 74 20 75 | 6e 72 6f 6c 6c 65 64 20 |is not u|nrolled |
|00005d00| 72 75 6e 73 0a 61 74 20 | 61 62 6f 75 74 20 35 30 |runs.at |about 50|
|00005d10| 20 4d 66 6c 6f 70 73 2e | 20 20 55 6e 72 6f 6c 6c | Mflops.| Unroll|
|00005d20| 69 6e 67 20 74 6f 20 61 | 20 64 65 70 74 68 20 6f |ing to a| depth o|
|00005d30| 66 20 31 36 20 72 65 73 | 75 6c 74 73 20 69 6e 20 |f 16 res|ults in |
|00005d40| 61 20 73 70 65 65 64 0a | 6f 66 20 38 30 20 4d 66 |a speed.|of 80 Mf|
|00005d50| 6c 6f 70 73 20 28 77 68 | 65 6e 20 6d 78 3d 6d 79 |lops (wh|en mx=my|
|00005d60| 3d 31 30 30 29 0a 20 20 | 20 20 20 55 6e 72 6f 6c |=100). | Unrol|
|00005d70| 6c 69 6e 67 20 63 61 6e | 20 62 65 20 63 6f 6e 74 |ling can| be cont|
|00005d80| 72 6f 6c 6c 65 64 20 77 | 69 74 68 20 74 68 65 20 |rolled w|ith the |
|00005d90| 63 6f 6d 6d 61 6e 64 20 | 6c 69 6e 65 20 73 77 69 |command |line swi|
|00005da0| 74 63 68 65 73 0a 6d 65 | 6e 74 69 6f 6e 65 64 20 |tches.me|ntioned |
|00005db0| 65 61 72 6c 69 65 72 20 | 61 6e 64 20 77 69 74 68 |earlier |and with|
|00005dc0| 20 74 68 65 20 63 6f 6d | 6d 61 6e 64 0a 0a 75 6e | the com|mand..un|
|00005dd0| 72 6f 6c 6c 20 28 20 38 | 20 29 0a 0a 69 6d 62 65 |roll ( 8| )..imbe|
|00005de0| 64 64 65 64 20 69 6e 20 | 74 68 65 20 73 6f 75 72 |dded in |the sour|
|00005df0| 63 65 2e 20 20 54 68 65 | 20 64 65 70 74 68 20 6d |ce. The| depth m|
|00005e00| 75 73 74 20 62 65 20 65 | 78 70 6c 69 63 69 74 20 |ust be e|xplicit |
|00005e10| 6f 66 20 63 6f 75 72 73 | 65 2e 0a 55 73 69 6e 67 |of cours|e..Using|
|00005e20| 20 74 68 65 20 69 6d 62 | 65 64 64 65 64 20 63 6f | the imb|edded co|
|00005e30| 6d 6d 61 6e 64 20 69 6e | 64 69 76 69 64 75 61 6c |mmand in|dividual|
|00005e40| 20 6c 6f 6f 70 73 20 63 | 61 6e 20 62 65 20 63 6f | loops c|an be co|
|00005e50| 6e 74 72 6f 6c 6c 65 64 | 0a 69 6e 64 65 70 65 6e |ntrolled|.indepen|
|00005e60| 64 65 6e 74 6c 79 2e 0a | 20 20 20 20 20 55 6e 66 |dently..| Unf|
|00005e70| 6f 72 74 75 6e 61 74 65 | 6c 79 2c 20 75 73 69 6e |ortunate|ly, usin|
|00005e80| 67 20 74 68 65 20 73 61 | 6d 65 20 74 72 69 63 6b |g the sa|me trick|
|00005e90| 20 6f 6e 20 6d 6f 72 65 | 20 63 6f 6d 70 6c 69 63 | on more| complic|
|00005ea0| 61 74 65 64 20 6c 6f 6f | 70 73 0a 61 63 74 75 61 |ated loo|ps.actua|
|00005eb0| 6c 6c 79 20 64 65 67 72 | 61 64 65 73 20 70 65 72 |lly degr|ades per|
|00005ec0| 66 6f 72 6d 61 6e 63 65 | 2c 20 73 69 6e 63 65 20 |formance|, since |
|00005ed0| 74 68 65 20 6c 6f 6f 70 | 73 20 62 65 63 6f 6d 65 |the loop|s become|
|00005ee0| 20 74 6f 6f 0a 63 6f 6d | 70 6c 69 63 61 74 65 64 | too.com|plicated|
|00005ef0| 20 66 6f 72 20 74 68 65 | 20 6f 70 74 69 6d 69 7a | for the| optimiz|
|00005f00| 65 72 2e 20 20 46 6f 72 | 20 74 68 69 73 20 72 65 |er. For| this re|
|00005f10| 61 73 6f 6e 20 74 68 65 | 72 65 20 69 73 20 61 20 |ason the|re is a |
|00005f20| 63 6f 6d 6d 61 6e 64 0a | 6c 69 6e 65 20 73 77 69 |command.|line swi|
|00005f30| 74 63 68 20 2d 4c 20 6e | 2c 20 77 68 69 63 68 20 |tch -L n|, which |
|00005f40| 69 6e 68 69 62 69 74 73 | 20 75 6e 72 6f 6c 6c 69 |inhibits| unrolli|
|00005f50| 6e 67 20 75 6e 6c 65 73 | 73 20 74 68 65 20 76 65 |ng unles|s the ve|
|00005f60| 63 74 6f 72 0a 73 74 61 | 74 65 6d 65 6e 74 20 69 |ctor.sta|tement i|
|00005f70| 73 20 6f 6e 20 6e 20 6f | 72 20 66 65 77 65 72 20 |s on n o|r fewer |
|00005f80| 6c 69 6e 65 73 2e 20 20 | 55 6e 72 6f 6c 6c 69 6e |lines. |Unrollin|
|00005f90| 67 20 69 73 20 61 6c 77 | 61 79 73 20 64 69 73 61 |g is alw|ays disa|
|00005fa0| 62 6c 65 64 0a 69 66 20 | 74 68 65 20 6e 75 6d 62 |bled.if |the numb|
|00005fb0| 65 72 20 6f 66 20 69 6e | 64 69 63 65 73 20 69 73 |er of in|dices is|
|00005fc0| 20 6e 6f 74 20 67 72 65 | 61 74 65 72 20 74 68 61 | not gre|ater tha|
|00005fd0| 6e 20 31 2c 20 73 69 6e | 63 65 20 69 74 20 77 6f |n 1, sin|ce it wo|
|00005fe0| 75 6c 64 0a 73 65 72 76 | 65 20 6e 6f 20 70 75 72 |uld.serv|e no pur|
|00005ff0| 70 6f 73 65 20 66 6f 72 | 20 31 20 69 6e 64 65 78 |pose for| 1 index|
|00006000| 20 6c 6f 6f 70 73 20 6f | 6e 20 74 68 65 20 76 65 | loops o|n the ve|
|00006010| 63 74 6f 72 20 6d 61 63 | 68 69 6e 65 73 20 66 6f |ctor mac|hines fo|
|00006020| 72 0a 77 68 69 63 68 20 | 69 74 20 69 73 20 69 6e |r.which |it is in|
|00006030| 74 65 6e 64 65 64 20 28 | 55 6e 72 6f 6c 6c 69 6e |tended (|Unrollin|
|00006040| 67 20 61 20 31 20 69 6e | 64 65 78 20 6c 6f 6f 70 |g a 1 in|dex loop|
|00006050| 20 77 69 6c 6c 20 69 6e | 68 69 62 69 74 0a 76 65 | will in|hibit.ve|
|00006060| 63 74 6f 72 69 7a 61 74 | 69 6f 6e 29 2e 20 20 54 |ctorizat|ion). T|
|00006070| 68 69 73 20 73 68 6f 75 | 6c 64 20 70 65 72 68 61 |his shou|ld perha|
|00006080| 70 73 20 62 65 20 61 20 | 63 6f 6d 6d 61 6e 64 20 |ps be a |command |
|00006090| 6c 69 6e 65 20 6f 70 74 | 69 6f 6e 0a 61 73 20 77 |line opt|ion.as w|
|000060a0| 65 6c 6c 2c 20 73 69 6e | 63 65 20 73 63 61 6c 61 |ell, sin|ce scala|
|000060b0| 72 20 6d 61 63 68 69 6e | 65 73 20 6d 61 79 20 64 |r machin|es may d|
|000060c0| 65 72 69 76 65 20 73 6f | 6d 65 20 62 65 6e 65 66 |erive so|me benef|
|000060d0| 69 74 20 66 6f 72 20 73 | 75 63 68 0a 6c 6f 6f 70 |it for s|uch.loop|
|000060e0| 73 2e 0a 20 20 20 20 20 | 4c 6f 6f 70 73 20 73 68 |s.. |Loops sh|
|000060f0| 6f 75 6c 64 20 6e 65 76 | 65 72 20 62 65 20 75 6e |ould nev|er be un|
|00006100| 72 6f 6c 6c 65 64 20 75 | 6e 6c 65 73 73 20 6f 6e |rolled u|nless on|
|00006110| 65 20 69 73 20 63 65 72 | 74 61 69 6e 20 74 68 61 |e is cer|tain tha|
|00006120| 74 0a 74 68 65 20 72 65 | 73 75 6c 74 20 69 73 20 |t.the re|sult is |
|00006130| 69 6e 64 65 70 65 6e 64 | 65 6e 74 20 6f 66 20 74 |independ|ent of t|
|00006140| 68 65 20 6f 72 64 65 72 | 20 6f 76 65 72 20 77 68 |he order| over wh|
|00006150| 69 63 68 20 74 68 65 20 | 69 6e 64 69 63 65 73 20 |ich the |indices |
|00006160| 61 72 65 0a 73 77 65 70 | 74 2e 20 20 55 73 75 61 |are.swep|t. Usua|
|00006170| 6c 6c 79 20 69 66 20 61 | 20 6c 6f 6f 70 20 69 73 |lly if a| loop is|
|00006180| 20 76 65 63 74 6f 72 69 | 7a 61 62 6c 65 20 6f 6e | vectori|zable on|
|00006190| 20 74 68 65 20 43 72 61 | 79 20 61 6e 64 20 63 61 | the Cra|y and ca|
|000061a0| 6e 20 62 65 0a 77 72 69 | 74 74 65 6e 20 69 6e 20 |n be.wri|tten in |
|000061b0| 74 68 69 73 20 6e 6f 74 | 61 74 69 6f 6e 2c 20 69 |this not|ation, i|
|000061c0| 74 20 63 61 6e 20 62 65 | 20 75 6e 72 6f 6c 6c 65 |t can be| unrolle|
|000061d0| 64 2e 20 20 41 20 6c 6f | 6f 70 20 73 75 63 68 20 |d. A lo|op such |
|000061e0| 61 73 0a 0a 5b 09 61 28 | 23 2c 23 29 20 3d 20 69 |as..[.a(|#,#) = i|
|000061f0| 0a 09 69 20 3d 20 69 20 | 2b 20 31 0a 5d 0a 0a 69 |..i = i |+ 1.]..i|
|00006200| 73 20 6e 6f 74 20 76 65 | 63 74 6f 72 69 7a 61 62 |s not ve|ctorizab|
|00006210| 6c 65 20 61 6e 64 20 69 | 66 20 75 6e 72 6f 6c 6c |le and i|f unroll|
|00006220| 65 64 20 74 68 65 20 72 | 65 73 75 6c 74 20 77 69 |ed the r|esult wi|
|00006230| 6c 6c 20 6e 6f 74 20 62 | 65 0a 69 6e 64 65 70 65 |ll not b|e.indepe|
|00006240| 6e 64 65 6e 74 20 6f 66 | 20 74 68 65 20 75 6e 72 |ndent of| the unr|
|00006250| 6f 6c 6c 69 6e 67 20 64 | 65 70 74 68 2e 20 20 4c |olling d|epth. L|
|00006260| 6f 77 20 70 72 65 63 69 | 73 69 6f 6e 20 63 61 6c |ow preci|sion cal|
|00006270| 63 75 6c 61 74 69 6f 6e | 73 20 6d 61 79 0a 73 68 |culation|s may.sh|
|00006280| 6f 77 20 64 69 66 66 65 | 72 65 6e 63 65 73 20 64 |ow diffe|rences d|
|00006290| 65 70 65 6e 64 69 6e 67 | 20 6f 6e 20 74 68 65 20 |epending| on the |
|000062a0| 64 65 70 74 68 20 62 65 | 63 61 75 73 65 20 6f 66 |depth be|cause of|
|000062b0| 20 72 6f 75 6e 64 20 6f | 66 66 20 65 72 72 6f 72 | round o|ff error|
|000062c0| 73 2e 0a 46 6f 72 20 69 | 6e 73 74 61 6e 63 65 2c |s..For i|nstance,|
|000062d0| 20 69 66 20 73 75 6d 20 | 69 73 20 61 20 33 32 20 | if sum |is a 32 |
|000062e0| 62 69 74 20 72 65 61 6c | 20 61 6e 64 20 61 20 69 |bit real| and a i|
|000062f0| 73 20 61 6e 20 61 72 72 | 61 79 20 6f 66 20 33 32 |s an arr|ay of 32|
|00006300| 20 6f 72 0a 36 34 20 62 | 69 74 20 72 65 61 6c 73 | or.64 b|it reals|
|00006310| 20 77 69 74 68 20 61 28 | 69 2c 6a 29 3d 69 2b 6d | with a(|i,j)=i+m|
|00006320| 69 2a 6a 20 77 68 65 72 | 65 20 74 68 65 20 64 69 |i*j wher|e the di|
|00006330| 6d 65 6e 73 69 6f 6e 73 | 20 61 72 65 20 6c 61 72 |mensions| are lar|
|00006340| 67 65 2c 0a 74 68 65 20 | 6c 6f 6f 70 0a 0a 09 73 |ge,.the |loop...s|
|00006350| 75 6d 20 3d 20 73 75 6d | 20 2b 20 61 28 23 2c 23 |um = sum| + a(#,#|
|00006360| 29 0a 0a 6d 61 79 20 64 | 69 66 66 65 72 20 69 6e |)..may d|iffer in|
|00006370| 20 74 68 65 20 6c 65 61 | 73 74 20 73 69 67 6e 69 | the lea|st signi|
|00006380| 66 69 63 61 6e 74 20 64 | 69 67 69 74 73 20 77 68 |ficant d|igits wh|
|00006390| 65 6e 20 75 6e 72 6f 6c | 6c 65 64 2e 20 20 54 68 |en unrol|led. Th|
|000063a0| 69 73 20 69 73 0a 62 65 | 63 61 75 73 65 20 77 68 |is is.be|cause wh|
|000063b0| 65 6e 20 6e 6f 74 20 75 | 6e 72 6f 6c 6c 69 6e 67 |en not u|nrolling|
|000063c0| 20 28 69 6e 20 74 68 69 | 73 20 65 78 61 6d 70 6c | (in thi|s exampl|
|000063d0| 65 29 20 73 6d 61 6c 6c | 20 6e 75 6d 62 65 72 73 |e) small| numbers|
|000063e0| 20 68 61 76 65 20 61 0a | 63 68 61 6e 63 65 20 74 | have a.|chance t|
|000063f0| 6f 20 61 64 64 20 75 70 | 20 62 65 66 6f 72 65 20 |o add up| before |
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.